regedit: Only show the context menu if the mouse is over a treeitem.

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hugh McMaster 2017-04-17 09:15:46 +00:00 committed by Alexandre Julliard
parent ab0d0c6ee4
commit 6f667d1c42
1 changed files with 4 additions and 3 deletions

View File

@ -376,10 +376,11 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
TVHITTESTINFO ht;
ht.pt = pt;
ScreenToClient(g_pChildWnd->hTreeWnd, &ht.pt);
if (SendMessageW(g_pChildWnd->hTreeWnd, TVM_HITTEST, 0, (LPARAM)&ht))
if (SendMessageW(g_pChildWnd->hTreeWnd, TVM_HITTEST, 0, (LPARAM)&ht)) {
SendMessageW(g_pChildWnd->hTreeWnd, TVM_SELECTITEM, TVGN_CARET, (LPARAM)ht.hItem);
TrackPopupMenu(GetSubMenu(hPopupMenus, PM_NEW), TPM_RIGHTBUTTON,
pt.x, pt.y, 0, hFrameWnd, NULL);
TrackPopupMenu(GetSubMenu(hPopupMenus, PM_NEW), TPM_RIGHTBUTTON,
pt.x, pt.y, 0, hFrameWnd, NULL);
}
}
case WM_KEYDOWN: