From b95557a7c42cbec1406a2ac7be1ca039c2fd21e0 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 9 Mar 2013 11:51:24 +0000 Subject: fixed crash when click SendSS item in main menu git-svn-id: http://svn.miranda-ng.org/main/trunk@3936 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SendScreenshotPlus/src/Utils.cpp | 13 +++++++++++++ plugins/SendScreenshotPlus/src/Utils.h | 2 ++ plugins/SendScreenshotPlus/src/global.h | 5 +++++ 3 files changed, 20 insertions(+) (limited to 'plugins/SendScreenshotPlus') diff --git a/plugins/SendScreenshotPlus/src/Utils.cpp b/plugins/SendScreenshotPlus/src/Utils.cpp index 70eb7a11df..ab74f569a1 100644 --- a/plugins/SendScreenshotPlus/src/Utils.cpp +++ b/plugins/SendScreenshotPlus/src/Utils.cpp @@ -26,6 +26,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "global.h" +//--------------------------------------------------------------------------- +//Workaround for MS bug ComboBox_SelectItemData +int ComboBox_SelectItemData(HWND hwndCtl, int indexStart, LPARAM data) { + int i = 0; + for ( i ; i < ComboBox_GetCount(hwndCtl); i++) { + if(data == ComboBox_GetItemData(hwndCtl, i)) { + ComboBox_SetCurSel (hwndCtl,i); + return i; + } + } + return CB_ERR; +} + //--------------------------------------------------------------------------- // MonitorInfoEnum size_t MonitorInfoEnum(MONITORINFOEX* & myMonitors, RECT & virtualScreen) { diff --git a/plugins/SendScreenshotPlus/src/Utils.h b/plugins/SendScreenshotPlus/src/Utils.h index 5091bda811..f82c0142a2 100644 --- a/plugins/SendScreenshotPlus/src/Utils.h +++ b/plugins/SendScreenshotPlus/src/Utils.h @@ -42,6 +42,8 @@ extern HWND g_hCapture; extern HBITMAP g_hBitmap, g_hbmMask; //--------------------------------------------------------------------------- +int ComboBox_SelectItemData(HWND hwndCtl, int indexStart, LPARAM data); + size_t MonitorInfoEnum(MONITORINFOEX* & myMonitors, RECT & virtualScreen); BOOL CALLBACK MonitorInfoEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData); diff --git a/plugins/SendScreenshotPlus/src/global.h b/plugins/SendScreenshotPlus/src/global.h index 66ee29e4a2..4d773e4258 100644 --- a/plugins/SendScreenshotPlus/src/global.h +++ b/plugins/SendScreenshotPlus/src/global.h @@ -44,6 +44,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include using namespace std; +#ifdef ComboBox_SelectItemData + // use Workaround for MS bug ComboBox_SelectItemData; + #undef ComboBox_SelectItemData +#endif + #include #include #include -- cgit v1.2.3