diff options
author | George Hazan <george.hazan@gmail.com> | 2025-05-12 17:25:26 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2025-05-12 17:25:26 +0300 |
commit | c9c2324e4f13e66c75d886f94dbacac1e28b191f (patch) | |
tree | 5dca20847ea0506c79547f7f5dede0fce765889f /plugins | |
parent | b0862a1dcc840b14b988b64a410bfc9076e624d3 (diff) |
fixes #5009 ("Pin to desktop" option doesn't work in all modern Windows)
Diffstat (limited to 'plugins')
26 files changed, 70 insertions, 790 deletions
diff --git a/plugins/Clist_modern/clist_modern.vcxproj b/plugins/Clist_modern/clist_modern.vcxproj index e6025e0e85..7490406f15 100644 --- a/plugins/Clist_modern/clist_modern.vcxproj +++ b/plugins/Clist_modern/clist_modern.vcxproj @@ -48,7 +48,6 @@ <ClCompile Include="src\modern_clui.cpp" />
<ClCompile Include="src\modern_cluiservices.cpp" />
<ClCompile Include="src\modern_contact.cpp" />
- <ClCompile Include="src\modern_docking.cpp" />
<ClCompile Include="src\modern_gdiplus.cpp" />
<ClCompile Include="src\modern_global.cpp" />
<ClCompile Include="src\modern_image_array.cpp" />
diff --git a/plugins/Clist_modern/clist_modern.vcxproj.filters b/plugins/Clist_modern/clist_modern.vcxproj.filters index e16c49886b..305bf19814 100644 --- a/plugins/Clist_modern/clist_modern.vcxproj.filters +++ b/plugins/Clist_modern/clist_modern.vcxproj.filters @@ -68,9 +68,6 @@ <ClCompile Include="src\modern_contact.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\modern_docking.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\modern_gdiplus.cpp">
<Filter>Source Files</Filter>
</ClCompile>
diff --git a/plugins/Clist_modern/res/resource.rc b/plugins/Clist_modern/res/resource.rc index fca73ca0c9..929295b400 100644 --- a/plugins/Clist_modern/res/resource.rc +++ b/plugins/Clist_modern/res/resource.rc @@ -451,7 +451,6 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN
GROUPBOX "Appearance",IDC_STWINDOWGROUP,4,11,115,37
CONTROL "Always on top",IDC_ONTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,21,102,8
- CONTROL "Pin to desktop",IDC_ONDESKTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,33,102,8
GROUPBOX "Client area margins",IDC_FRAME_META2,124,64,179,45
EDITTEXT IDC_LEFTMARGIN,152,82,33,12,ES_NUMBER
CONTROL "",IDC_LEFTMARGINSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,174,83,11,12
diff --git a/plugins/Clist_modern/src/cluiframes.cpp b/plugins/Clist_modern/src/cluiframes.cpp index 746247f164..b980f7b9cf 100644 --- a/plugins/Clist_modern/src/cluiframes.cpp +++ b/plugins/Clist_modern/src/cluiframes.cpp @@ -138,17 +138,10 @@ int SetAlpha(uint8_t Alpha) HWND hwnd = F.OwnerWindow;
long l = GetWindowLongPtr(hwnd, GWL_EXSTYLE);
if (!(l & WS_EX_LAYERED)) {
- HWND parent = nullptr;
- if (g_CluiData.fOnDesktop) {
- HWND hProgMan = FindWindow(L"Progman", nullptr);
- if (IsWindow(hProgMan))
- parent = hProgMan;
- }
-
CLUI_ShowWindowMod(hwnd, SW_HIDE);
SetParent(hwnd, nullptr);
SetWindowLongPtr(hwnd, GWL_EXSTYLE, l | WS_EX_LAYERED);
- SetParent(hwnd, parent);
+ SetParent(hwnd, nullptr);
if (l&WS_VISIBLE) CLUI_ShowWindowMod(hwnd, SW_SHOW);
}
SetLayeredWindowAttributes(hwnd, g_CluiData.dwKeyColor, Alpha, LWA_ALPHA | LWA_COLORKEY);
@@ -174,21 +167,14 @@ int CLUIFrames_ActivateSubContainers(BOOL active) {
for (int i = 0; i < g_nFramesCount; i++) {
FRAMEWND &F = g_pfwFrames[i];
- if (active && !F.floating && F.OwnerWindow != (HWND)nullptr && F.OwnerWindow != (HWND)-2 && F.visible && !F.needhide) {
- if (g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT)) {
- SetWindowPos(F.OwnerWindow, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
- SetWindowPos(F.OwnerWindow, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
- }
- else SetWindowPos(F.OwnerWindow, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE);
- }
+ if (active && !F.floating && F.OwnerWindow != (HWND)nullptr && F.OwnerWindow != (HWND)-2 && F.visible && !F.needhide)
+ SetWindowPos(F.OwnerWindow, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE);
}
return 0;
}
int CLUIFrames_SetParentForContainers(HWND parent)
{
- g_CluiData.fOnDesktop = (parent && parent != g_clistApi.hwndContactList);
-
for (int i = 0; i < g_nFramesCount; i++) {
FRAMEWND &F = g_pfwFrames[i];
if (!F.floating && F.OwnerWindow != (HWND)nullptr && F.OwnerWindow != (HWND)-2 && F.visible && !F.needhide) {
@@ -218,11 +204,7 @@ int CLUIFrames_OnShowHide(int mode) if (mode != SW_HIDE) {
SetWindowPos(F.OwnerWindow, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
- if (g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT)) {
- SetWindowPos(F.OwnerWindow, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
- SetWindowPos(F.OwnerWindow, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
- }
- else SetWindowPos(F.OwnerWindow, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE);
+ SetWindowPos(F.OwnerWindow, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE);
}
}
@@ -1348,9 +1330,6 @@ static int _us_DoCollapseFrame(WPARAM wParam, LPARAM lParam) if (FrameId >= 0 && FrameId < g_nFramesCount) {
// do not collapse/uncollapse client/locked/invisible frames
if (g_pfwFrames[FrameId].align == alClient && !(g_pfwFrames[FrameId].Locked || (!g_pfwFrames[FrameId].visible) || g_pfwFrames[FrameId].floating)) {
- if (Clist_IsDocked())
- return 0;
-
if (g_CluiData.fDocked || !g_CluiData.fAutoSize) {
RECT rc;
GetWindowRect(g_clistApi.hwndContactList, &rc);
@@ -2988,12 +2967,6 @@ static HWND CreateSubContainerWindow(HWND parent, int x, int y, int width, int h {
HWND hwnd = CreateWindowEx(WS_EX_LAYERED, CLUIFrameSubContainerClassName, L"SubContainerWindow", WS_POPUP | (!g_CluiData.fLayered ? WS_BORDER : 0), x, y, width, height, parent, nullptr, g_plugin.getInst(), nullptr);
SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) & ~(WS_CAPTION | WS_BORDER));
- if (g_CluiData.fOnDesktop) {
- HWND hProgMan = FindWindow(L"Progman", nullptr);
- if (IsWindow(hProgMan))
- SetParent(hwnd, hProgMan);
- }
-
return hwnd;
}
diff --git a/plugins/Clist_modern/src/init.cpp b/plugins/Clist_modern/src/init.cpp index 799f0f12a6..16ee18c048 100644 --- a/plugins/Clist_modern/src/init.cpp +++ b/plugins/Clist_modern/src/init.cpp @@ -207,7 +207,6 @@ static HRESULT SubclassClistInterface() g_clistApi.pfnProcessExternalMessages = cli_ProcessExternalMessages;
g_clistApi.pfnAddEvent = cli_AddEvent;
g_clistApi.pfnFreeEvent = cli_RemoveEvent;
- g_clistApi.pfnDocking_ProcessWindowMessage = Docking_ProcessWindowMessage;
return S_OK;
}
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index 528efe806b..abb187115b 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -936,7 +936,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP } //====== End of Non-Layered Mode =====
CheckDlgButton(hwndDlg, IDC_FADEINOUT, db_get_b(0, "CLUI", "FadeInOut", SETTING_FADEIN_DEFAULT));
- CheckDlgButton(hwndDlg, IDC_ONDESKTOP, g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT));
+
SendDlgItemMessage(hwndDlg, IDC_FRAMESSPIN, UDM_SETRANGE, 0, MAKELONG(50, 0));
SendDlgItemMessage(hwndDlg, IDC_CAPTIONSSPIN, UDM_SETRANGE, 0, MAKELONG(50, 0));
SendDlgItemMessage(hwndDlg, IDC_FRAMESSPIN, UDM_SETPOS, 0, db_get_dw(0, "CLUIFrames", "GapBetweenFrames", SETTING_GAPFRAMES_DEFAULT));
@@ -1013,12 +1013,6 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP CheckDlgButton(hwndDlg, IDC_LAYERENGINE, BST_CHECKED);
}
}
- else if (LOWORD(wParam) == IDC_ONDESKTOP && IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP)) {
- CheckDlgButton(hwndDlg, IDC_ONTOP, BST_UNCHECKED);
- }
- else if (LOWORD(wParam) == IDC_ONTOP && IsDlgButtonChecked(hwndDlg, IDC_ONTOP)) {
- CheckDlgButton(hwndDlg, IDC_ONDESKTOP, BST_UNCHECKED);
- }
else if (LOWORD(wParam) == IDC_TOOLWND) {
EnableWindow(GetDlgItem(hwndDlg, IDC_MIN2TRAY), BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_TOOLWND));
}
@@ -1072,7 +1066,6 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP db_unset(0, "ModernData", "EnableLayering");
}
g_CluiData.dwKeyColor = db_get_dw(0, "ModernSettings", "KeyColor", (uint32_t)SETTING_KEYCOLOR_DEFAULT);
- g_plugin.setByte("OnDesktop", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
Clist::bOnTop = IsDlgButtonChecked(hwndDlg, IDC_ONTOP);
SetWindowPos(g_clistApi.hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
db_set_b(0, "CLUI", "DragToScroll", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DRAGTOSCROLL));
@@ -1095,21 +1088,11 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP g_bChangingMode = true;
- if (IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP)) {
- HWND hProgMan = FindWindow(L"Progman", nullptr);
- if (IsWindow(hProgMan)) {
- SetParent(g_clistApi.hwndContactList, hProgMan);
- Sync(CLUIFrames_SetParentForContainers, (HWND)hProgMan);
- g_CluiData.fOnDesktop = true;
- }
- }
- else {
- if (GetParent(g_clistApi.hwndContactList)) {
- SetParent(g_clistApi.hwndContactList, nullptr);
- Sync(CLUIFrames_SetParentForContainers, (HWND)nullptr);
- }
- g_CluiData.fOnDesktop = false;
+ if (GetParent(g_clistApi.hwndContactList)) {
+ SetParent(g_clistApi.hwndContactList, nullptr);
+ Sync(CLUIFrames_SetParentForContainers, (HWND)nullptr);
}
+
AniAva_UpdateParent();
db_set_b(0, "CLUI", "FadeInOut", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_FADEINOUT));
g_CluiData.fSmoothAnimation = IsDlgButtonChecked(hwndDlg, IDC_FADEINOUT) != 0;
@@ -1124,7 +1107,6 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP Clist::bTransparent = IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT);
Clist::iAlpha = SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0);
Clist::iAutoAlpha = SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0);
- g_plugin.setByte("OnDesktop", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
ske_LoadSkinFromDB();
CLUI_UpdateLayeredMode();
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp index 2a3e5da2ba..cba1eb9792 100644 --- a/plugins/Clist_modern/src/modern_clistmod.cpp +++ b/plugins/Clist_modern/src/modern_clistmod.cpp @@ -127,7 +127,6 @@ int CListMod_ContactListShutdownProc(WPARAM, LPARAM) HRESULT PreLoadContactListModule()
{
/* Global data initialization */
- g_CluiData.fOnDesktop = false;
g_CluiData.dwKeyColor = RGB(255, 0, 255);
g_CluiData.bCurrentAlpha = 255;
@@ -180,7 +179,7 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY) if (IsIconic(hWnd) || !IsWindowVisible(hWnd))
return GWVS_HIDDEN;
- if (g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT) || !Clist::bBringToFront)
+ if (!Clist::bBringToFront)
return GWVS_VISIBLE;
HWND hwndFocused = GetFocus();
@@ -220,7 +219,7 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY) GetWindowRect(hWnd, &rc);
RECT rcMonitor = { 0 };
- Docking_GetMonitorRectFromWindow(hWnd, &rcMonitor);
+ GetMonitorRectFromWindow(hWnd, &rcMonitor);
rc.top = rc.top < rcMonitor.top ? rcMonitor.top : rc.top;
rc.left = rc.left < rcMonitor.left ? rcMonitor.left : rc.left;
@@ -336,19 +335,13 @@ int cliShowHide(bool bAlwaysShow) Sync(CLUIFrames_ActivateSubContainers, TRUE);
CLUI_ShowWindowMod(g_clistApi.hwndContactList, SW_RESTORE);
- if (!g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT)) {
- Sync(CLUIFrames_OnShowHide, 1); //TO BE PROXIED
- SetWindowPos(g_clistApi.hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
- g_bCalledFromShowHide = 1;
- if (!Clist::bOnTop)
- SetWindowPos(g_clistApi.hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
- g_bCalledFromShowHide = 0;
- }
- else {
+ Sync(CLUIFrames_OnShowHide, 1); //TO BE PROXIED
+ SetWindowPos(g_clistApi.hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+ g_bCalledFromShowHide = 1;
+ if (!Clist::bOnTop)
SetWindowPos(g_clistApi.hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
- Sync(CLUIFrames_OnShowHide, 1);
- SetForegroundWindow(g_clistApi.hwndContactList);
- }
+ g_bCalledFromShowHide = 0;
+
g_plugin.setByte("State", SETTING_STATE_NORMAL);
RECT rcWindow;
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 500f7ca2d6..ec29f6c318 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -683,15 +683,6 @@ void CLUI_ChangeWindowMode() }
SetWindowText(g_clistApi.hwndContactList, titleText);
- // < ->
- // 1 - If visible store it and hide
- if (g_CluiData.fLayered && (g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT))) {
- SetParent(g_clistApi.hwndContactList, nullptr);
- Sync(CLUIFrames_SetParentForContainers, (HWND)nullptr);
- UpdateWindow(g_clistApi.hwndContactList);
- g_CluiData.fOnDesktop = false;
- }
-
// 5 - TODO Apply Style
oldStyleEx = curStyleEx = GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE);
oldStyle = curStyle = GetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE);
@@ -716,23 +707,9 @@ void CLUI_ChangeWindowMode() else
SetMenu(g_clistApi.hwndContactList, g_clistApi.hMenuMain);
- if (g_CluiData.fLayered && (g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT)))
- ske_UpdateWindowImage();
-
// 6 - Pin to desktop mode
- if (g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT)) {
- HWND hProgMan = FindWindow(L"Progman", nullptr);
- if (IsWindow(hProgMan)) {
- SetParent(g_clistApi.hwndContactList, hProgMan);
- Sync(CLUIFrames_SetParentForContainers, (HWND)hProgMan);
- g_CluiData.fOnDesktop = true;
- }
- }
- else {
- SetParent(g_clistApi.hwndContactList, nullptr);
- Sync(CLUIFrames_SetParentForContainers, (HWND)nullptr);
- g_CluiData.fOnDesktop = false;
- }
+ SetParent(g_clistApi.hwndContactList, nullptr);
+ Sync(CLUIFrames_SetParentForContainers, (HWND)nullptr);
// 7 - if it was visible - show
if (storedVisMode) {
@@ -751,7 +728,7 @@ void CLUI_ChangeWindowMode() int v = (r.bottom - r.top) > (w * 2) ? w : (r.bottom - r.top);
h = (h < v) ? h : v;
HRGN hRgn1 = CreateRoundRectRgn(0, 0, (r.right - r.left + 1), (r.bottom - r.top + 1), h, h);
- if (db_get_b(0, "CLC", "RoundCorners", SETTING_ROUNDCORNERS_DEFAULT) && !Clist_IsDocked())
+ if (db_get_b(0, "CLC", "RoundCorners", SETTING_ROUNDCORNERS_DEFAULT))
SetWindowRgn(g_clistApi.hwndContactList, hRgn1, 1);
else {
DeleteObject(hRgn1);
@@ -808,7 +785,7 @@ int CLUI_HideBehindEdge() //Need to be moved out of screen
bShowEventStarted = 0;
//1. get work area rectangle
- Docking_GetMonitorRectFromWindow(g_clistApi.hwndContactList, &rcScreen);
+ GetMonitorRectFromWindow(g_clistApi.hwndContactList, &rcScreen);
//SystemParametersInfo(SPI_GETWORKAREA, 0, &rcScreen,FALSE);
//2. move out
int bordersize = wBehindEdgeBorderSize;
@@ -848,7 +825,7 @@ int CLUI_ShowFromBehindEdge() // Need to be moved out of screen
// 1. get work area rectangle
RECT rcScreen;
- Docking_GetMonitorRectFromWindow(g_clistApi.hwndContactList, &rcScreen);
+ GetMonitorRectFromWindow(g_clistApi.hwndContactList, &rcScreen);
// 2. move out
RECT rcWindow;
@@ -1693,12 +1670,10 @@ LRESULT CLUI::OnSizingMoving(UINT msg, WPARAM wParam, LPARAM lParam) CheckFramesPos(&rc);
Sync(CLUIFrames_OnMoving, m_hWnd, &rc);
if (!IsIconic(m_hWnd)) {
- if (!Clist_IsDocked()) { // if g_CluiData.fDocked, dont remember pos (except for width)
- g_plugin.setDword("Height", (uint32_t)(rc.bottom - rc.top));
- g_plugin.setDword("x", (uint32_t)rc.left);
- g_plugin.setDword("y", (uint32_t)rc.top);
- }
+ g_plugin.setDword("Height", (uint32_t)(rc.bottom - rc.top));
g_plugin.setDword("Width", (uint32_t)(rc.right - rc.left));
+ g_plugin.setDword("x", (uint32_t)rc.left);
+ g_plugin.setDword("y", (uint32_t)rc.top);
}
}
return TRUE;
@@ -1730,14 +1705,11 @@ LRESULT CLUI::OnSizingMoving(UINT msg, WPARAM wParam, LPARAM lParam) }
// if g_CluiData.fDocked, dont remember pos (except for width)
- if (!Clist_IsDocked()) {
- g_plugin.setDword("Height", (uint32_t)(rc.bottom - rc.top));
- g_plugin.setDword("x", (uint32_t)rc.left);
- g_plugin.setDword("y", (uint32_t)rc.top);
- }
- else SetWindowRgn(m_hWnd, nullptr, 0);
+ g_plugin.setDword("Height", (uint32_t)(rc.bottom - rc.top));
g_plugin.setDword("Width", (uint32_t)(rc.right - rc.left));
-
+ g_plugin.setDword("x", (uint32_t)rc.left);
+ g_plugin.setDword("y", (uint32_t)rc.top);
+
if (!g_CluiData.fLayered) {
HRGN hRgn1;
RECT r;
@@ -1747,7 +1719,7 @@ LRESULT CLUI::OnSizingMoving(UINT msg, WPARAM wParam, LPARAM lParam) int v = (r.bottom - r.top) > (w * 2) ? w : (r.bottom - r.top);
h = (h < v) ? h : v;
hRgn1 = CreateRoundRectRgn(0, 0, (r.right - r.left + 1), (r.bottom - r.top + 1), h, h);
- if (db_get_b(0, "CLC", "RoundCorners", SETTING_ROUNDCORNERS_DEFAULT) && !Clist_IsDocked())
+ if (db_get_b(0, "CLC", "RoundCorners", SETTING_ROUNDCORNERS_DEFAULT))
SetWindowRgn(m_hWnd, hRgn1, FALSE);
else {
DeleteObject(hRgn1);
@@ -2239,8 +2211,6 @@ LRESULT CLUI::OnSysCommand(UINT msg, WPARAM wParam, LPARAM lParam) }
DefWindowProc(m_hWnd, msg, wParam, lParam);
- if (g_plugin.getByte("OnDesktop", SETTING_ONDESKTOP_DEFAULT))
- Sync(CLUIFrames_ActivateSubContainers, TRUE);
return FALSE;
}
@@ -2282,7 +2252,7 @@ LRESULT CLUI::OnListSizeChangeNotify(NMCLISTCONTROL *pnmc) rcWindow = rcSizingRect;
else
GetWindowRect(m_hWnd, &rcWindow);
- if (!g_CluiData.fAutoSize || g_clistApi.hwndContactTree == nullptr || Clist_IsDocked())
+ if (!g_CluiData.fAutoSize || g_clistApi.hwndContactTree == nullptr)
return FALSE;
maxHeight = db_get_b(0, "CLUI", "MaxSizeHeight", SETTING_MAXSIZEHEIGHT_DEFAULT);
diff --git a/plugins/Clist_modern/src/modern_commonprototypes.h b/plugins/Clist_modern/src/modern_commonprototypes.h index d84b89c2a3..bd108c3770 100644 --- a/plugins/Clist_modern/src/modern_commonprototypes.h +++ b/plugins/Clist_modern/src/modern_commonprototypes.h @@ -152,7 +152,6 @@ int SetAlpha(uint8_t Alpha); /* others TODO: move above */
-int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam);
void DrawBackGround(HWND hwnd, HDC mhdc, HBITMAP hBmpBackground, COLORREF bkColour, uint32_t backgroundBmpUse);
HRESULT BackgroundsLoadModule();
int BackgroundsUnloadModule();
@@ -181,7 +180,7 @@ INT_PTR ToggleHideOffline(WPARAM wParam, LPARAM lParam); INT_PTR SetUseGroups(WPARAM wParam, LPARAM lParam); //contact.c
INT_PTR ToggleSounds(WPARAM wParam, LPARAM lParam); //contact.c
void ClcOptionsChanged(); //clc.c
-void Docking_GetMonitorRectFromWindow(HWND hWnd, RECT *rc); //Docking.c
+void GetMonitorRectFromWindow(HWND hWnd, RECT *rc); //Docking.c
void DrawAvatarImageWithGDIp(HDC hDestDC, int x, int y, uint32_t width, uint32_t height, HBITMAP hbmp, int x1, int y1, uint32_t width1, uint32_t height1, uint32_t flag, uint8_t alpha); //gdiplus.cpp
void InitGdiPlus(); //gdiplus.cpp
void ShutdownGdiPlus(); //gdiplus.cpp
diff --git a/plugins/Clist_modern/src/modern_defsettings.h b/plugins/Clist_modern/src/modern_defsettings.h index 469ae95f19..868484cf14 100644 --- a/plugins/Clist_modern/src/modern_defsettings.h +++ b/plugins/Clist_modern/src/modern_defsettings.h @@ -35,7 +35,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define SETTING_THINBORDER_DEFAULT 0
#define SETTING_NOBORDER_DEFAULT 0
#define SETTING_WINDOWSHADOW_DEFAULT 0
-#define SETTING_ONDESKTOP_DEFAULT 0
#define SETTING_DISABLEWORKINGSET_DEFAULT 1
#define SETTING_ALWAYSVISICON_DEFAULT 0
diff --git a/plugins/Clist_modern/src/modern_docking.cpp b/plugins/Clist_modern/src/modern_docking.cpp deleted file mode 100644 index 55d04d6e58..0000000000 --- a/plugins/Clist_modern/src/modern_docking.cpp +++ /dev/null @@ -1,337 +0,0 @@ -/*
-
-Miranda NG: the free IM client for Microsoft* Windows*
-
-Copyright (C) 2012-25 Miranda NG team (https://miranda-ng.org),
-Copyright (c) 2000-08 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "stdafx.h"
-#include "modern_sync.h"
-
-#define WM_DOCKCALLBACK (WM_USER+121)
-#define WM_CREATEDOCKED (WM_USER+122)
-#define EDGESENSITIVITY 3
-
-#define DOCKED_NONE 0
-#define DOCKED_LEFT 1
-#define DOCKED_RIGHT 2
-
-BOOL LockSubframeMoving = 0;
-static int TempDock = 0;
-static int dock_drag_dx = 0;
-static int dock_drag_dy = 0;
-
-static void Docking_GetMonitorRectFromPoint(POINT pt, RECT *rc)
-{
- MONITORINFO monitorInfo;
- HMONITOR hMonitor = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST); // always returns a valid value
- monitorInfo.cbSize = sizeof(MONITORINFO);
-
- if (GetMonitorInfo(hMonitor, &monitorInfo))
- {
- memcpy(rc, &monitorInfo.rcMonitor, sizeof(RECT));
- return;
- }
-
- // "generic" win95/NT support, also serves as failsafe
- rc->left = 0;
- rc->top = 0;
- rc->bottom = GetSystemMetrics(SM_CYSCREEN);
- rc->right = GetSystemMetrics(SM_CXSCREEN);
-}
-
-void Docking_GetMonitorRectFromWindow(HWND hWnd, RECT *rc)
-{
- POINT ptWindow;
- GetWindowRect(hWnd, rc);
- ptWindow.x = rc->left;
- ptWindow.y = rc->top;
- Docking_GetMonitorRectFromPoint(ptWindow, rc);
-}
-
-static void Docking_AdjustPosition(HWND hwnd, RECT *rcDisplay, RECT *rc)
-{
- APPBARDATA abd;
-
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = hwnd;
- abd.uEdge = g_CluiData.fDocked == DOCKED_LEFT ? ABE_LEFT : ABE_RIGHT;
- abd.rc = *rc;
- abd.rc.top = rcDisplay->top;
- abd.rc.bottom = rcDisplay->bottom;
- if (g_CluiData.fDocked == DOCKED_LEFT) {
- abd.rc.right = rcDisplay->left + abd.rc.right - abd.rc.left;
- abd.rc.left = rcDisplay->left;
- }
- else {
- abd.rc.left = rcDisplay->right - (abd.rc.right - abd.rc.left);
- abd.rc.right = rcDisplay->right;
-
- }
- SHAppBarMessage(ABM_SETPOS, &abd);
- *rc = abd.rc;
-}
-
-int Docking_IsDocked(WPARAM, LPARAM)
-{
- return g_CluiData.fDocked;
-}
-
-int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam)
-{
- APPBARDATA abd;
- static int draggingTitle;
- MSG *msg = (MSG*)wParam;
-
- if (msg->message == WM_DESTROY)
- g_plugin.setByte("Docked", (uint8_t)g_CluiData.fDocked);
-
- if (!g_CluiData.fDocked && msg->message != WM_CREATE && msg->message != WM_MOVING && msg->message != WM_CREATEDOCKED && msg->message != WM_MOVE && msg->message != WM_SIZE) return 0;
- switch (msg->message) {
- case WM_CREATE:
- //if (GetSystemMetrics(SM_CMONITORS)>1) return 0;
- if (g_plugin.getByte("Docked", 0) && db_get_b(0, "CLUI", "DockToSides", SETTING_DOCKTOSIDES_DEFAULT))
- {
- PostMessage(msg->hwnd, WM_CREATEDOCKED, 0, 0);
- }
- draggingTitle = 0;
- return 0;
-
- case WM_CREATEDOCKED:
- //we need to post a message just after creation to let main message function do some work
- g_CluiData.fDocked = (BOOL)g_plugin.getByte("Docked", 0);
- if (IsWindowVisible(msg->hwnd) && !IsIconic(msg->hwnd)) {
- RECT rc, rcMonitor;
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- abd.lParam = 0;
- abd.uCallbackMessage = WM_DOCKCALLBACK;
- SHAppBarMessage(ABM_NEW, &abd);
- GetWindowRect(msg->hwnd, &rc);
- Docking_GetMonitorRectFromWindow(msg->hwnd, &rcMonitor);
- Docking_AdjustPosition(msg->hwnd, &rcMonitor, &rc);
- MoveWindow(msg->hwnd, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, TRUE);
- g_CluiData.mutexPreventDockMoving = 0;
- Sync(CLUIFrames_OnMoving, msg->hwnd, &rc);
- g_CluiData.mutexPreventDockMoving = 1;
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);
- }
- break;
- case WM_CAPTURECHANGED:
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);
- return 0;
- case WM_ACTIVATE:
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- SHAppBarMessage(ABM_ACTIVATE, &abd);
- return 0;
- case WM_SIZE:
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_REDRAW_ALL, nullptr);
- return 0;
-
- case WM_WINDOWPOSCHANGED:
- {
- if (g_CluiData.fDocked)
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);
- return 0;
- }
- case WM_MOVING:
- {
- RECT rcMonitor;
- RECT rcWindow;
- RECT *rc;
- int dx = 0;
- POINT ptCursor;
- if (g_CluiData.fDocked) return 0;
-
- // GetMessagePos() is no good, position is always unsigned
- GetCursorPos(&ptCursor);
- GetWindowRect(msg->hwnd, &rcWindow);
- dock_drag_dx = rcWindow.left - ptCursor.x;
- dock_drag_dy = rcWindow.top - ptCursor.y;
- Docking_GetMonitorRectFromPoint(ptCursor, &rcMonitor);
-
- if (((ptCursor.x < rcMonitor.left + EDGESENSITIVITY)
- || (ptCursor.x >= rcMonitor.right - EDGESENSITIVITY))
- && db_get_b(0, "CLUI", "DockToSides", SETTING_DOCKTOSIDES_DEFAULT))
- {
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- abd.lParam = 0;
- abd.uCallbackMessage = WM_DOCKCALLBACK;
- SHAppBarMessage(ABM_NEW, &abd);
- if (ptCursor.x < rcMonitor.left + EDGESENSITIVITY) g_CluiData.fDocked = DOCKED_LEFT;
- else g_CluiData.fDocked = DOCKED_RIGHT;
- // TempDock = 1;
- GetWindowRect(msg->hwnd, (LPRECT)msg->lParam);
- rc = (RECT*)msg->lParam;
- if (g_CluiData.fDocked == DOCKED_RIGHT)
- dx = (rc->right > rcMonitor.right) ? rc->right - rcMonitor.right : 0;
- else
- dx = (rc->left < rcMonitor.left) ? rc->left - rcMonitor.left : 0;
- OffsetRect(rc, -dx, 0);
- Docking_AdjustPosition(msg->hwnd, (LPRECT)&rcMonitor, (LPRECT)msg->lParam);
- SendMessage(msg->hwnd, WM_SIZE, 0, 0);
- g_CluiData.mutexPreventDockMoving = 0;
- Sync(CLUIFrames_OnMoving, msg->hwnd, (LPRECT)msg->lParam);
- g_CluiData.mutexPreventDockMoving = 1;
- mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
- g_plugin.setByte("Docked", (uint8_t)g_CluiData.fDocked);
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);
- return TRUE;
- }
- return 0;
- }
- case WM_EXITSIZEMOVE:
- {
- RECT rcMonitor;
- RECT rcWindow;
- if (TempDock) TempDock = 0;
- GetWindowRect(msg->hwnd, &rcWindow);
- Docking_GetMonitorRectFromWindow(msg->hwnd, &rcMonitor);
- Docking_AdjustPosition(msg->hwnd, &rcMonitor, &rcWindow);
- *((LRESULT*)lParam) = TRUE;
- g_CluiData.mutexPreventDockMoving = 0;
- SetWindowPos(msg->hwnd, nullptr, rcWindow.left, rcWindow.top, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOREDRAW | SWP_NOSENDCHANGING);
- Sync(CLUIFrames_OnMoving, msg->hwnd, &rcWindow);
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);// -= -= -=
- g_CluiData.mutexPreventDockMoving = 1;
- return 1;
- }
-
- case WM_MOVE:
- {
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_ALT_DRAW, nullptr);
- return 0;
- }
- case WM_SIZING:
- {
- if (g_CluiData.fDocked) ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);
- return FALSE;
- }
- case WM_SHOWWINDOW:
- {
- if (msg->lParam)
- return 0;
- if ((msg->wParam && g_CluiData.fDocked < 0) || (!msg->wParam && g_CluiData.fDocked>0))
- g_CluiData.fDocked = -g_CluiData.fDocked;
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- if (msg->wParam) {
- RECT rc, rcMonitor;
- Docking_GetMonitorRectFromWindow(msg->hwnd, &rcMonitor);
- abd.lParam = 0;
- abd.uCallbackMessage = WM_DOCKCALLBACK;
- SHAppBarMessage(ABM_NEW, &abd);
- GetWindowRect(msg->hwnd, &rc);
- Docking_AdjustPosition(msg->hwnd, &rcMonitor, &rc);
- MoveWindow(msg->hwnd, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, FALSE);
- Sync(CLUIFrames_OnMoving, msg->hwnd, &rc);
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);// -= -= -=
- }
- else {
- SHAppBarMessage(ABM_REMOVE, &abd);
- }
- }
- return 0;
- case WM_NCHITTEST:
- { LONG result;
- result = DefWindowProc(msg->hwnd, WM_NCHITTEST, msg->wParam, msg->lParam);
- if (result == HTSIZE || result == HTTOP || result == HTTOPLEFT || result == HTTOPRIGHT ||
- result == HTBOTTOM || result == HTBOTTOMRIGHT || result == HTBOTTOMLEFT) {
- *((LRESULT*)lParam) = HTCLIENT; return TRUE;
- }
- if (g_CluiData.fDocked == DOCKED_LEFT && result == HTLEFT) { *((LRESULT*)lParam) = HTCLIENT; return TRUE; }
- if (g_CluiData.fDocked == DOCKED_RIGHT && result == HTRIGHT) { *((LRESULT*)lParam) = HTCLIENT; return TRUE; }
-
-
- return 0;
- }
- case WM_SYSCOMMAND:
- if ((msg->wParam & 0xFFF0) != SC_MOVE) return 0;
- SetActiveWindow(msg->hwnd);
- SetCapture(msg->hwnd);
- draggingTitle = 1;
- *((LRESULT*)lParam) = 0;
- return TRUE;
- case WM_MOUSEMOVE:
-
- if (!draggingTitle) return 0;
- { RECT rc;
- POINT pt;
- GetClientRect(msg->hwnd, &rc);
- if (((g_CluiData.fDocked == DOCKED_LEFT || g_CluiData.fDocked == -DOCKED_LEFT) && (short)LOWORD(msg->lParam) > rc.right) ||
- ((g_CluiData.fDocked == DOCKED_RIGHT || g_CluiData.fDocked == -DOCKED_RIGHT) && (short)LOWORD(msg->lParam) < 0)) {
- ReleaseCapture();
- draggingTitle = 0;
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- SHAppBarMessage(ABM_REMOVE, &abd);
- g_CluiData.fDocked = 0;
- GetCursorPos(&pt);
- PostMessage(msg->hwnd, WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(pt.x, pt.y));
- SetWindowPos(msg->hwnd, nullptr, pt.x - rc.right / 2, pt.y - GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYSMCAPTION) / 2, g_plugin.getDword("Width", 0), g_plugin.getDword("Height", 0), SWP_NOZORDER);
- g_plugin.setByte("Docked", (uint8_t)g_CluiData.fDocked);
- // ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);
- }
- return 1;
- }
- case WM_LBUTTONUP:
- if (draggingTitle) {
- ReleaseCapture();
- draggingTitle = 0;
- }
- return 0;
- case WM_DOCKCALLBACK:
- switch (msg->wParam) {
- case ABN_WINDOWARRANGE:
- CLUI_ShowWindowMod(msg->hwnd, msg->lParam ? SW_HIDE : SW_SHOW);
- {
-
- RECT rc, rcMonitor;
- Docking_GetMonitorRectFromWindow(msg->hwnd, &rcMonitor);
- GetWindowRect(msg->hwnd, &rc);
- Docking_AdjustPosition(msg->hwnd, &rcMonitor, &rc);
- Sync(CLUIFrames_OnMoving, msg->hwnd, &rc); // -= -= -=
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);
-
- g_CluiData.mutexPreventDockMoving = 1;
- }
- break;
- }
- return TRUE;
- case WM_DESTROY:
- if (g_CluiData.fDocked > 0) {
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- SHAppBarMessage(ABM_REMOVE, &abd);
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);
- }
- return 0;
- }
- return 0;
-}
diff --git a/plugins/Clist_modern/src/modern_global_structure.h b/plugins/Clist_modern/src/modern_global_structure.h index 689d06b7de..28cd3507a8 100644 --- a/plugins/Clist_modern/src/modern_global_structure.h +++ b/plugins/Clist_modern/src/modern_global_structure.h @@ -44,7 +44,6 @@ struct CLUIDATA bool bEventAreaEnabled;
bool bNotifyActive;
bool fDisableSkinEngine;
- bool fOnDesktop;
bool fSmoothAnimation;
bool fLayered;
bool fSortOfflineBottom;
diff --git a/plugins/Clist_modern/src/modern_static_clui.h b/plugins/Clist_modern/src/modern_static_clui.h index 891dcf53f3..475d389997 100644 --- a/plugins/Clist_modern/src/modern_static_clui.h +++ b/plugins/Clist_modern/src/modern_static_clui.h @@ -62,7 +62,7 @@ int CListMod_HideWindow(HWND hwndContactList, int mode); int CLUIServices_LoadModule(void);
INT_PTR CLUIServices_SortList(WPARAM wParam, LPARAM lParam);
-void Docking_GetMonitorRectFromWindow(HWND hWnd, RECT *rc);
+void GetMonitorRectFromWindow(HWND hWnd, RECT *rc);
int EventArea_Create(HWND hCluiWnd);
diff --git a/plugins/Clist_modern/src/modern_utils.cpp b/plugins/Clist_modern/src/modern_utils.cpp index 2cea1b9a1a..2210a2c3ab 100644 --- a/plugins/Clist_modern/src/modern_utils.cpp +++ b/plugins/Clist_modern/src/modern_utils.cpp @@ -62,3 +62,27 @@ BOOL DestroyIcon_protect(HICON icon) if (icon) return DestroyIcon(icon);
return FALSE;
}
+
+void GetMonitorRectFromWindow(HWND hWnd, RECT *rc)
+{
+ POINT pt;
+ GetWindowRect(hWnd, rc);
+ pt.x = rc->left;
+ pt.y = rc->top;
+
+ MONITORINFO monitorInfo;
+ HMONITOR hMonitor = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST); // always returns a valid value
+ monitorInfo.cbSize = sizeof(MONITORINFO);
+
+ if (GetMonitorInfoW(hMonitor, &monitorInfo)) {
+ memcpy(rc, &monitorInfo.rcMonitor, sizeof(RECT));
+ return;
+ }
+
+ // "generic" win95/NT support, also serves as failsafe
+ rc->left = 0;
+ rc->top = 0;
+ rc->bottom = GetSystemMetrics(SM_CYSCREEN);
+ rc->right = GetSystemMetrics(SM_CXSCREEN);
+
+}
diff --git a/plugins/Clist_modern/src/resource.h b/plugins/Clist_modern/src/resource.h index 8e46e99484..7fd519e3a3 100644 --- a/plugins/Clist_modern/src/resource.h +++ b/plugins/Clist_modern/src/resource.h @@ -250,7 +250,6 @@ #define IDC_HILIGHTMODE2 1659
#define IDC_HILIGHTMODE1 1660
#define IDC_HILIGHTMODE3 1661
-#define IDC_ONDESKTOP 1662
#define IDC_HILIGHTMODE4 1663
#define IDC_USECONNECTINGICON 1761
#define IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK 1761
diff --git a/plugins/Clist_nicer/clist_nicer.vcxproj b/plugins/Clist_nicer/clist_nicer.vcxproj index ddd953463b..4aaf9f33d3 100644 --- a/plugins/Clist_nicer/clist_nicer.vcxproj +++ b/plugins/Clist_nicer/clist_nicer.vcxproj @@ -97,7 +97,6 @@ <ClCompile Include="src\contact.cpp" />
<ClCompile Include="src\coolsblib.cpp" />
<ClCompile Include="src\coolscroll.cpp" />
- <ClCompile Include="src\Docking.cpp" />
<ClCompile Include="src\extBackg.cpp" />
<ClCompile Include="src\groupmenu.cpp" />
<ClCompile Include="src\init.cpp" />
diff --git a/plugins/Clist_nicer/clist_nicer.vcxproj.filters b/plugins/Clist_nicer/clist_nicer.vcxproj.filters index 1dcfb14ca5..cfbf35fa34 100644 --- a/plugins/Clist_nicer/clist_nicer.vcxproj.filters +++ b/plugins/Clist_nicer/clist_nicer.vcxproj.filters @@ -68,9 +68,6 @@ <ClCompile Include="src\coolscroll.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\Docking.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\extBackg.cpp">
<Filter>Source Files</Filter>
</ClCompile>
diff --git a/plugins/Clist_nicer/res/resource.rc b/plugins/Clist_nicer/res/resource.rc index 7311258a93..5a8bc95314 100644 --- a/plugins/Clist_nicer/res/resource.rc +++ b/plugins/Clist_nicer/res/resource.rc @@ -209,7 +209,6 @@ BEGIN COMBOBOX IDC_BORDERSTYLE,62,60,64,56,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
LTEXT "Title bar text:",IDC_STATIC,11,80,51,8
EDITTEXT IDC_TITLETEXT,62,79,64,12,ES_AUTOHSCROLL
- CONTROL "Pin to desktop",IDC_ONDESKTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,96,128,10
CONTROL "Show drop shadow (restart required)",IDC_DROPSHADOW,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,108,138,10
CONTROL "Hide contact list after it has been idle for",IDC_AUTOHIDE,
diff --git a/plugins/Clist_nicer/src/Docking.cpp b/plugins/Clist_nicer/src/Docking.cpp deleted file mode 100644 index 71ba8ee99f..0000000000 --- a/plugins/Clist_nicer/src/Docking.cpp +++ /dev/null @@ -1,289 +0,0 @@ -/*
-
-Miranda NG: the free IM client for Microsoft* Windows*
-
-Copyright (C) 2012-25 Miranda NG team (https://miranda-ng.org),
-Copyright (c) 2000-03 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "stdafx.h"
-
-#define WM_DOCKCALLBACK (WM_USER+121)
-#define WM_CREATEDOCKED (WM_USER+122)
-#define EDGESENSITIVITY 3
-
-#define DOCKED_NONE 0
-#define DOCKED_LEFT 1
-#define DOCKED_RIGHT 2
-int g_iDocked;
-
-extern RECT cluiPos;
-
-static void Docking_GetMonitorRectFromPoint(POINT pt, RECT *rc)
-{
- MONITORINFO monitorInfo;
- HMONITOR hMonitor = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST); // always returns a valid value
- monitorInfo.cbSize = sizeof(MONITORINFO);
-
- if (GetMonitorInfo(hMonitor, &monitorInfo)) {
- memcpy(rc, &monitorInfo.rcMonitor, sizeof(RECT));
- return;
- }
-
- // "generic" win95/NT support, also serves as failsafe
- rc->left = 0;
- rc->top = 0;
- rc->bottom = GetSystemMetrics(SM_CYSCREEN);
- rc->right = GetSystemMetrics(SM_CXSCREEN);
-}
-
-static void Docking_GetMonitorRectFromWindow(HWND hWnd, RECT *rc)
-{
- POINT ptWindow;
- GetWindowRect(hWnd, rc);
- ptWindow.x = rc->left;
- ptWindow.y = rc->top;
- Docking_GetMonitorRectFromPoint(ptWindow, rc);
-}
-
-static void Docking_AdjustPosition(HWND hwnd, RECT *rcDisplay, RECT *rc)
-{
- APPBARDATA abd;
-
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = hwnd;
- abd.uEdge = g_iDocked == DOCKED_LEFT ? ABE_LEFT : ABE_RIGHT;
- abd.rc = *rc;
- abd.rc.top = rcDisplay->top;
- abd.rc.bottom = rcDisplay->bottom;
- if (g_iDocked == DOCKED_LEFT) {
- abd.rc.right = rcDisplay->left + (abd.rc.right - abd.rc.left) - cfg::dat.bClipBorder;
- abd.rc.left = rcDisplay->left - cfg::dat.bClipBorder;
- }
- else {
- abd.rc.left = rcDisplay->right - (abd.rc.right - abd.rc.left) + cfg::dat.bClipBorder;
- abd.rc.right = rcDisplay->right + cfg::dat.bClipBorder;
- }
- SHAppBarMessage(ABM_SETPOS, &abd);
- *rc = abd.rc;
-}
-
-int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam)
-{
- APPBARDATA abd;
- static int draggingTitle;
- MSG *msg = (MSG *)wParam;
-
- if (msg->message == WM_DESTROY)
- g_plugin.setByte("Docked", (uint8_t)g_iDocked);
- if (!g_iDocked && msg->message != WM_CREATE && msg->message != WM_MOVING && msg->message != WM_CREATEDOCKED && msg->message != WM_MOVE)
- return 0;
-
- switch (msg->message) {
- case WM_CREATE:
- //if (GetSystemMetrics(SM_CMONITORS)>1) return 0;
- if (g_plugin.getByte("Docked", 0))
- PostMessage(msg->hwnd, WM_CREATEDOCKED, 0, 0);
- draggingTitle = 0;
- return 0;
-
- case WM_CREATEDOCKED:
- //we need to post a message just after creation to let main message function do some work
- g_iDocked = (int)(char)g_plugin.getByte("Docked", 0);
- if (IsWindowVisible(msg->hwnd) && !IsIconic(msg->hwnd)) {
- RECT rc, rcMonitor;
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- abd.lParam = 0;
- abd.uCallbackMessage = WM_DOCKCALLBACK;
- SHAppBarMessage(ABM_NEW, &abd);
- GetWindowRect(msg->hwnd, &rc);
- Docking_GetMonitorRectFromWindow(msg->hwnd, &rcMonitor);
- Docking_AdjustPosition(msg->hwnd, &rcMonitor, &rc);
- MoveWindow(msg->hwnd, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, TRUE);
- }
- break;
-
- case WM_ACTIVATE:
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- SHAppBarMessage(ABM_ACTIVATE, &abd);
- return 0;
-
- case WM_WINDOWPOSCHANGED:
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- SHAppBarMessage(ABM_WINDOWPOSCHANGED, &abd);
- return 0;
-
- case WM_MOVING:
- {
- RECT rcMonitor;
- POINT ptCursor;
-
- // stop early
- if (GetAsyncKeyState(VK_CONTROL) & 0x8000)
- return 0;
-
- // GetMessagePos() is no good, position is always unsigned
- GetCursorPos(&ptCursor);
- Docking_GetMonitorRectFromPoint(ptCursor, &rcMonitor);
-
- if ((ptCursor.x < rcMonitor.left + EDGESENSITIVITY) || (ptCursor.x >= rcMonitor.right - EDGESENSITIVITY)) {
- if (!(GetWindowLongPtr(msg->hwnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW)) {
- SendMessage(msg->hwnd, CLUIINTM_REDRAW, 0, 0);
- MessageBox(nullptr, TranslateT("The contact list cannot be docked when using the default title bar and border. Use a toolwindow or borderless style instead."),
- TranslateT("Contact list docking"), MB_OK);
- return 0;
- }
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- abd.lParam = 0;
- abd.uCallbackMessage = WM_DOCKCALLBACK;
- SHAppBarMessage(ABM_NEW, &abd);
- if (ptCursor.x < rcMonitor.left + EDGESENSITIVITY)
- g_iDocked = DOCKED_LEFT;
- else
- g_iDocked = DOCKED_RIGHT;
- SendMessage(msg->hwnd, WM_LBUTTONUP, 0, MAKELPARAM(ptCursor.x, ptCursor.y));
- GetWindowRect(msg->hwnd, (LPRECT)msg->lParam);
- Docking_AdjustPosition(msg->hwnd, (LPRECT)&rcMonitor, (LPRECT)msg->lParam);
- PostMessage(msg->hwnd, CLUIINTM_REDRAW, 0, 0);
- return TRUE;
- }
- }
- return 0;
-
- case WM_MOVE:
- if (g_iDocked) {
- RECT rc, rcMonitor;
- Docking_GetMonitorRectFromWindow(msg->hwnd, &rcMonitor);
- GetWindowRect(msg->hwnd, &rc);
- Docking_AdjustPosition(msg->hwnd, &rcMonitor, &rc);
- MoveWindow(msg->hwnd, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, TRUE);
- return 1;
- }
- return 0;
-
- case WM_SIZING:
- {
- RECT rcMonitor;
- Docking_GetMonitorRectFromWindow(msg->hwnd, &rcMonitor);
- Docking_AdjustPosition(msg->hwnd, &rcMonitor, (LPRECT)msg->lParam);
- *((LRESULT *)lParam) = TRUE;
- }
- return TRUE;
-
- case WM_SHOWWINDOW:
- if (msg->lParam)
- return 0;
- if ((msg->wParam && g_iDocked < 0) || (!msg->wParam && g_iDocked > 0))
- g_iDocked = -g_iDocked;
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- if (msg->wParam) {
- RECT rc, rcMonitor;
- Docking_GetMonitorRectFromWindow(msg->hwnd, &rcMonitor);
- abd.lParam = 0;
- abd.uCallbackMessage = WM_DOCKCALLBACK;
- SHAppBarMessage(ABM_NEW, &abd);
- GetWindowRect(msg->hwnd, &rc);
- Docking_AdjustPosition(msg->hwnd, &rcMonitor, &rc);
- MoveWindow(msg->hwnd, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, FALSE);
- }
- else SHAppBarMessage(ABM_REMOVE, &abd);
- return 0;
-
- case WM_NCHITTEST:
- {
- LONG result = DefWindowProc(msg->hwnd, WM_NCHITTEST, msg->wParam, msg->lParam);
- if (result == HTSIZE || result == HTTOP || result == HTTOPLEFT || result == HTTOPRIGHT || result == HTBOTTOM || result == HTBOTTOMRIGHT || result == HTBOTTOMLEFT) {
- *((LRESULT *)lParam) = HTCLIENT; return TRUE;
- }
- if (g_iDocked == DOCKED_LEFT && result == HTLEFT) {
- *((LRESULT *)lParam) = HTCLIENT; return TRUE;
- }
- if (g_iDocked == DOCKED_RIGHT && result == HTRIGHT) {
- *((LRESULT *)lParam) = HTCLIENT; return TRUE;
- }
- }
- return 0;
-
- case WM_SYSCOMMAND:
- if ((msg->wParam & 0xFFF0) != SC_MOVE)
- return 0;
- SetActiveWindow(msg->hwnd);
- SetCapture(msg->hwnd);
- draggingTitle = 1;
- *((LRESULT *)lParam) = 0;
- return TRUE;
-
- case WM_MOUSEMOVE:
- if (!draggingTitle)
- return 0; {
- RECT rc;
- POINT pt;
- GetClientRect(msg->hwnd, &rc);
- if (((g_iDocked == DOCKED_LEFT || g_iDocked == -DOCKED_LEFT) && (short)LOWORD(msg->lParam) > rc.right) || ((g_iDocked == DOCKED_RIGHT || g_iDocked == -DOCKED_RIGHT) && (short)LOWORD(msg->lParam) < 0)) {
- ReleaseCapture();
- draggingTitle = 0;
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- SHAppBarMessage(ABM_REMOVE, &abd);
- g_iDocked = 0;
- GetCursorPos(&pt);
- PostMessage(msg->hwnd, WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(pt.x, pt.y));
- SetWindowPos(msg->hwnd, nullptr, pt.x - rc.right / 2, pt.y - GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYSMCAPTION) / 2, cluiPos.right, cluiPos.bottom, SWP_NOZORDER);
- }
- }
- return 1;
-
- case WM_LBUTTONUP:
- if (draggingTitle) {
- ReleaseCapture();
- draggingTitle = 0;
- }
- return 0;
-
- case WM_DOCKCALLBACK:
- switch (msg->wParam) {
- case ABN_WINDOWARRANGE:
- ShowWindow(msg->hwnd, msg->lParam ? SW_HIDE : SW_SHOW);
- break;
- }
- return TRUE;
-
- case WM_DESTROY:
- if (g_iDocked > 0) {
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- SHAppBarMessage(ABM_REMOVE, &abd);
- }
- return 0;
- }
- return 0;
-}
diff --git a/plugins/Clist_nicer/src/clc.h b/plugins/Clist_nicer/src/clc.h index 42af57eb1b..38bceff19f 100644 --- a/plugins/Clist_nicer/src/clc.h +++ b/plugins/Clist_nicer/src/clc.h @@ -422,9 +422,6 @@ void CluiProtocolStatusChanged(int, const char*); void LoadSkinItemToCache(struct TExtraCache *cEntry);
-// Docking.c
-extern int g_iDocked;
-
// Buttons
#define BUTTONSETIMLICON (WM_USER+20)
diff --git a/plugins/Clist_nicer/src/clistopts.cpp b/plugins/Clist_nicer/src/clistopts.cpp index 1b8dca6242..fdc192cd6b 100644 --- a/plugins/Clist_nicer/src/clistopts.cpp +++ b/plugins/Clist_nicer/src/clistopts.cpp @@ -305,7 +305,6 @@ public: CheckDlgButton(m_hwnd, IDC_ALWAYSHIDEONTASKBAR, g_plugin.getByte("AlwaysHideOnTB", 1) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(m_hwnd, IDC_FADEINOUT, cfg::dat.fadeinout ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(m_hwnd, IDC_DROPSHADOW, g_plugin.getByte("WindowShadow", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(m_hwnd, IDC_ONDESKTOP, g_plugin.getByte("OnDesktop", 0) ? BST_CHECKED : BST_UNCHECKED);
chkAutoSize.SetState(cfg::dat.autosize);
@@ -446,7 +445,7 @@ public: Clist::iAlpha = cfg::dat.alpha = SendDlgItemMessage(m_hwnd, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0);
Clist::iAutoAlpha = cfg::dat.autoalpha = SendDlgItemMessage(m_hwnd, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0);
g_plugin.setByte("WindowShadow", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_DROPSHADOW));
- g_plugin.setByte("OnDesktop", (uint8_t)IsDlgButtonChecked(m_hwnd, IDC_ONDESKTOP));
+
db_set_dw(0, "CLUI", "Frameflags", cfg::dat.dwFlags);
cfg::dat.bFullTransparent = IsDlgButtonChecked(m_hwnd, IDC_FULLTRANSPARENT) ? 1 : 0;
db_set_b(0, "CLUI", "fulltransparent", (uint8_t)cfg::dat.bFullTransparent);
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 0cff6042ec..e662e6ba63 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -576,8 +576,6 @@ static void sttProcessResize(HWND hwnd, NMCLISTCONTROL *nmc) if (!db_get_b(0, "CLUI", "AutoSize", 0))
return;
- if (g_iDocked)
- return;
if (hFrameContactTree == 0)
return;
@@ -948,15 +946,14 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l }
if (cfg::dat.bClipBorder != 0 || cfg::dat.dwFlags & CLUI_FRAME_ROUNDEDFRAME) {
- int docked = Clist_IsDocked();
int clip = cfg::dat.bClipBorder;
if (!g_CLUISkinnedBkColor)
FillRect(hdc, &rcClient, cfg::dat.hBrushColorKey);
if (cfg::dat.dwFlags & CLUI_FRAME_ROUNDEDFRAME)
- rgn = CreateRoundRectRgn(clip, docked ? 0 : clip, rcClient.right - clip + 1, rcClient.bottom - (docked ? 0 : clip - 1), 8 + clip, 8 + clip);
+ rgn = CreateRoundRectRgn(clip, clip, rcClient.right - clip + 1, rcClient.bottom - (clip - 1), 8 + clip, 8 + clip);
else
- rgn = CreateRectRgn(clip, docked ? 0 : clip, rcClient.right - clip, rcClient.bottom - (docked ? 0 : clip));
+ rgn = CreateRectRgn(clip, clip, rcClient.right - clip, rcClient.bottom - clip);
SelectClipRgn(hdc, rgn);
}
@@ -1034,9 +1031,6 @@ skipbg: break;
case WM_WINDOWPOSCHANGED:
- if (g_iDocked)
- break;
-
case WM_WINDOWPOSCHANGING:
if (g_clistApi.hwndContactList != nullptr) {
WINDOWPOS *wp = (WINDOWPOS *)lParam;
@@ -1077,8 +1071,7 @@ skipbg: return 0;
case WM_SIZE:
- if ((wParam == 0 && lParam == 0) || g_iDocked) {
-
+ if (wParam == 0 && lParam == 0) {
if (IsZoomed(hwnd))
ShowWindow(hwnd, SW_SHOWNORMAL);
@@ -1099,22 +1092,18 @@ skipbg: case WM_MOVE:
if (!IsIconic(hwnd)) {
GetWindowRect(hwnd, &rc);
-
- if (!g_iDocked) {
- cluiPos.bottom = (uint32_t)(rc.bottom - rc.top);
- cluiPos.left = rc.left;
- cluiPos.top = rc.top;
- }
+ cluiPos.bottom = (uint32_t)(rc.bottom - rc.top);
+ cluiPos.left = rc.left;
+ cluiPos.top = rc.top;
cluiPos.right = rc.right - rc.left;
+
if (cfg::dat.realTimeSaving) {
GetWindowRect(hwnd, &rc);
// if docked, dont remember pos (except for width)
- if (!Clist_IsDocked()) {
- g_plugin.setDword("Height", (uint32_t)(rc.bottom - rc.top));
- g_plugin.setDword("x", (uint32_t)rc.left);
- g_plugin.setDword("y", (uint32_t)rc.top);
- }
+ g_plugin.setDword("Height", (uint32_t)(rc.bottom - rc.top));
+ g_plugin.setDword("x", (uint32_t)rc.left);
+ g_plugin.setDword("y", (uint32_t)rc.top);
g_plugin.setDword("Width", (uint32_t)(rc.right - rc.left));
}
}
diff --git a/plugins/Clist_nicer/src/cluiframes.cpp b/plugins/Clist_nicer/src/cluiframes.cpp index 81d68a682e..9c09cec1f6 100644 --- a/plugins/Clist_nicer/src/cluiframes.cpp +++ b/plugins/Clist_nicer/src/cluiframes.cpp @@ -1206,13 +1206,10 @@ INT_PTR CLUIFramesCollapseUnCollapseFrame(WPARAM wParam, LPARAM) // do not collapse/uncollapse client/locked/invisible frames
if (Frames[FrameId].align == alClient && !(Frames[FrameId].Locked || (!Frames[FrameId].visible) || Frames[FrameId].floating)) {
- RECT rc;
- if (Clist_IsDocked())
- return 0;
-
if (db_get_b(0, "CLUI", "AutoSize", 0))
return 0;
+ RECT rc;
GetWindowRect(g_clistApi.hwndContactList, &rc);
if (Frames[FrameId].collapsed == TRUE) {
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp index 4ec2a18cc0..2012338e90 100644 --- a/plugins/Clist_nicer/src/init.cpp +++ b/plugins/Clist_nicer/src/init.cpp @@ -34,7 +34,6 @@ CLIST_INTERFACE coreCli; extern HICON overlayicons[10];
-int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam);
int SetHideOffline(int iValue);
ClcContact *CreateClcContact(void);
@@ -176,7 +175,6 @@ int CMPlugin::Load() g_clistApi.pfnCluiProtocolStatusChanged = CluiProtocolStatusChanged;
g_clistApi.pfnCompareContacts = CompareContacts;
g_clistApi.pfnCreateClcContact = CreateClcContact;
- g_clistApi.pfnDocking_ProcessWindowMessage = Docking_ProcessWindowMessage;
g_clistApi.pfnGetContactHiddenStatus = CLVM_GetContactHiddenStatus;
g_clistApi.pfnGetDefaultFontSetting = GetDefaultFontSetting;
g_clistApi.pfnGetRowBottomY = RowHeight::getItemBottomY;
diff --git a/plugins/Clist_nicer/src/resource.h b/plugins/Clist_nicer/src/resource.h index c67d6c1ceb..259646b7fc 100644 --- a/plugins/Clist_nicer/src/resource.h +++ b/plugins/Clist_nicer/src/resource.h @@ -193,7 +193,6 @@ #define IDC_RELOAD 1635
#define IDC_IGN_ADDPERMANENTLY 1635
#define IDC_DSP_LOADDEFAULT 1636
-#define IDC_ONDESKTOP 1657
#define IDC_WINCOLOUR 1659
#define IDC_APPLYLASTVIEWMODE 1661
#define IDC_IGNORESELFORGROUPS 1722
diff --git a/plugins/StatusManager/src/ss_main.cpp b/plugins/StatusManager/src/ss_main.cpp index 8820699781..52d704d42e 100644 --- a/plugins/StatusManager/src/ss_main.cpp +++ b/plugins/StatusManager/src/ss_main.cpp @@ -388,7 +388,7 @@ int SSModuleLoaded(WPARAM, LPARAM) WINDOWPLACEMENT wndpl = { sizeof(wndpl) }; if (GetWindowPlacement(hClist, &wndpl)) { - if (wndpl.showCmd == SW_SHOWNORMAL && !Clist_IsDocked()) { + if (wndpl.showCmd == SW_SHOWNORMAL) { RECT rc; if (GetWindowRect(hClist, &rc)) { int x = rc.left; |