Commit ab0d0c6e authored by Hugh McMaster's avatar Hugh McMaster Committed by Alexandre Julliard

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

parent 4dc5a764
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment