From 24a39515399e9555dd0e4ad72b7a22f9152b0adf Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 19 May 2015 12:50:25 +0000 Subject: end of zoo with WM_CONTEXTMENU's lParam git-svn-id: http://svn.miranda-ng.org/main/trunk@13693 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/ContactsPlus/src/receive.cpp | 13 ++++++++----- plugins/ContactsPlus/src/stdafx.h | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'plugins/ContactsPlus') 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 +#include #include #include #include -- cgit v1.2.3