From 981eb26ecb81af9b0fa2cd887461884bcc3fbb0e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 16 Apr 2018 12:04:48 +0300 Subject: fixes #1271 (Warning if FloatingContacts is installed and "Disable drag and drop of items" in clist settings is enabled) --- plugins/FloatingContacts/src/main.cpp | 19 ++++++++++++------- plugins/FloatingContacts/src/version.h | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) (limited to 'plugins') diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp index dd95992094..94c00f420b 100644 --- a/plugins/FloatingContacts/src/main.cpp +++ b/plugins/FloatingContacts/src/main.cpp @@ -25,7 +25,6 @@ static void LoadContacts(void); static void LoadContact(MCONTACT hContact); // Internal funcs -static void RepaintWindow(HWND hwnd, HDC hdc); static void CreateThumbWnd(wchar_t *ptszName, MCONTACT hContact, int nX, int nY); static void RegisterWindowClass(void); static void UnregisterWindowClass(void); @@ -355,7 +354,6 @@ static LRESULT __stdcall CommWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM if (pThumb) { HDC hdc = GetWindowDC(hwnd); BitBlt(hdc, 0, 0, pThumb->bmpContent.getWidth(), pThumb->bmpContent.getHeight(), pThumb->bmpContent.getDC(), 0, 0, SRCCOPY); - //RepaintWindow( hwnd, hdc ); ReleaseDC(hwnd, hdc); ValidateRect(hwnd, nullptr); return 0; @@ -366,7 +364,6 @@ static LRESULT __stdcall CommWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM PAINTSTRUCT ps; HDC hdc = BeginPaint(hwnd, &ps); BitBlt(hdc, 0, 0, pThumb->bmpContent.getWidth(), pThumb->bmpContent.getHeight(), pThumb->bmpContent.getDC(), 0, 0, SRCCOPY); - //RepaintWindow( hwnd, hdc ); EndPaint(hwnd, &ps); break; } @@ -375,7 +372,6 @@ static LRESULT __stdcall CommWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM case WM_PRINTCLIENT: if (pThumb) { BitBlt((HDC)wParam, 0, 0, pThumb->bmpContent.getWidth(), pThumb->bmpContent.getHeight(), pThumb->bmpContent.getDC(), 0, 0, SRCCOPY); - //RepaintWindow(hwnd, (HDC)wParam); break; } @@ -388,15 +384,18 @@ static LRESULT __stdcall CommWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM break; case WM_LBUTTONDOWN: - if (pThumb) pThumb->OnLButtonDown(); + if (pThumb) + pThumb->OnLButtonDown(); break; case WM_MOUSEMOVE: - if (pThumb) pThumb->OnMouseMove(LOWORD(lParam), HIWORD(lParam)); + if (pThumb) + pThumb->OnMouseMove(LOWORD(lParam), HIWORD(lParam)); break; case WM_LBUTTONUP: - if (pThumb) pThumb->OnLButtonUp(); + if (pThumb) + pThumb->OnLButtonUp(); break; case WM_LBUTTONDBLCLK: @@ -879,6 +878,12 @@ static int OnModulesLoded(WPARAM, LPARAM) hwndMiranda = pcli->hwndContactList; mir_subclassWindow(hwndMiranda, newMirandaWndProc); + UINT_PTR dwStyle = SendMessageW(pcli->hwndContactTree, CLM_GETEXSTYLE, 0, 0); + if (dwStyle & CLS_EX_DISABLEDRAGDROP) + MessageBox(hwndMiranda, + TranslateT("Floating contacts plugin won't work until you uncheck the \"Disable drag and drop of items\" option in Options - Contact list"), + TranslateT("Floating contacts"), MB_ICONWARNING | MB_OK); + // No thumbs yet bEnableTip = ServiceExists("mToolTip/ShowTip"); diff --git a/plugins/FloatingContacts/src/version.h b/plugins/FloatingContacts/src/version.h index fa0d9ca2d2..77ad61b72a 100644 --- a/plugins/FloatingContacts/src/version.h +++ b/plugins/FloatingContacts/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0 #define __MINOR_VERSION 7 #define __RELEASE_NUM 0 -#define __BUILD_NUM 4 +#define __BUILD_NUM 5 #include -- cgit v1.2.3