summaryrefslogtreecommitdiff
path: root/plugins/SendScreenshotPlus
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-03-09 11:51:24 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-03-09 11:51:24 +0000
commitb95557a7c42cbec1406a2ac7be1ca039c2fd21e0 (patch)
tree8d74bbe401664846ef0c6b2603ac9026cd529e2e /plugins/SendScreenshotPlus
parent3e1d25be1eb2dfa0a6456636e2fcbf368c981243 (diff)
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
Diffstat (limited to 'plugins/SendScreenshotPlus')
-rw-r--r--plugins/SendScreenshotPlus/src/Utils.cpp13
-rw-r--r--plugins/SendScreenshotPlus/src/Utils.h2
-rw-r--r--plugins/SendScreenshotPlus/src/global.h5
3 files changed, 20 insertions, 0 deletions
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
@@ -27,6 +27,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) {
MONITORS tmp = {0,0};
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 <string>
using namespace std;
+#ifdef ComboBox_SelectItemData
+ // use Workaround for MS bug ComboBox_SelectItemData;
+ #undef ComboBox_SelectItemData
+#endif
+
#include <win2k.h>
#include <msapi/vsstyle.h>
#include <msapi/vssym32.h>