summaryrefslogtreecommitdiff
path: root/plugins/ContactsPlus
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-05-19 12:50:25 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-05-19 12:50:25 +0000
commit24a39515399e9555dd0e4ad72b7a22f9152b0adf (patch)
tree3577b4bf1442497133aa1646bdb3443950ed0cef /plugins/ContactsPlus
parent400d7bb71630f774dc9392cad37a22528958e2bc (diff)
end of zoo with WM_CONTEXTMENU's lParam
git-svn-id: http://svn.miranda-ng.org/main/trunk@13693 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ContactsPlus')
-rw-r--r--plugins/ContactsPlus/src/receive.cpp13
-rw-r--r--plugins/ContactsPlus/src/stdafx.h1
2 files changed, 9 insertions, 5 deletions
diff --git a/plugins/ContactsPlus/src/receive.cpp b/plugins/ContactsPlus/src/receive.cpp
index d11cbcb3a4..73fcba99e9 100644
--- a/plugins/ContactsPlus/src/receive.cpp
+++ b/plugins/ContactsPlus/src/receive.cpp
@@ -405,14 +405,17 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
case WM_CONTEXTMENU:
{
HWND hLV = GetDlgItem(hwndDlg, IDC_CONTACTS);
- LVHITTESTINFO lvh;
RECT rt;
wndData->iPopupItem = -1;
- if ((HWND)wParam != hLV) break; // if not our ListView go away
- lvh.pt.x = LOWORD(lParam);
- lvh.pt.y = HIWORD(lParam);
- if (GetWindowRect(hLV, &rt)==0) return FALSE; // ?? why this, some check ??
+ if ((HWND)wParam != hLV)
+ break; // if not our ListView go away
+
+ LVHITTESTINFO lvh;
+ lvh.pt.x = GET_X_LPARAM(lParam);
+ lvh.pt.y = GET_Y_LPARAM(lParam);
+ GetWindowRect(hLV, &rt);
+
ScreenToClient(hLV, &lvh.pt); // convert to ListView local coordinates
int ci = ListView_HitTest(hLV, &lvh);
if (ci==-1) break; // mouse is not over any item
diff --git a/plugins/ContactsPlus/src/stdafx.h b/plugins/ContactsPlus/src/stdafx.h
index 0d52891be5..a6e99bc3d6 100644
--- a/plugins/ContactsPlus/src/stdafx.h
+++ b/plugins/ContactsPlus/src/stdafx.h
@@ -22,6 +22,7 @@
// ---------------------------------------------------------------------------
#include <windows.h>
+#include <windowsx.h>
#include <commctrl.h>
#include <malloc.h>
#include <time.h>