regedit: Select the targeted treeview item on right mouse click.

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:36 +00:00 committed by Alexandre Julliard
parent 4dc5a764c7
commit ab0d0c6ee4
1 changed files with 8 additions and 3 deletions

View File

@ -372,9 +372,14 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
break;
case WM_CONTEXTMENU: {
int x = GET_X_LPARAM(lParam);
int y = GET_Y_LPARAM(lParam);
TrackPopupMenu(GetSubMenu(hPopupMenus, PM_NEW), TPM_RIGHTBUTTON, x, y, 0, hFrameWnd, NULL);
POINT pt = {GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)};
TVHITTESTINFO ht;
ht.pt = pt;
ScreenToClient(g_pChildWnd->hTreeWnd, &ht.pt);
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);
}
case WM_KEYDOWN: