diff options
Diffstat (limited to 'plugins/ContactsPlus/src')
-rw-r--r-- | plugins/ContactsPlus/src/receive.cpp | 13 | ||||
-rw-r--r-- | plugins/ContactsPlus/src/stdafx.h | 1 |
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>
|