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

regedit: Use a separate pop-up menu for the 'Computer' root node.

parent d09571d1
...@@ -377,9 +377,11 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa ...@@ -377,9 +377,11 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
ht.pt = pt; ht.pt = pt;
ScreenToClient(g_pChildWnd->hTreeWnd, &ht.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)) {
HTREEITEM root;
SendMessageW(g_pChildWnd->hTreeWnd, TVM_SELECTITEM, TVGN_CARET, (LPARAM)ht.hItem); SendMessageW(g_pChildWnd->hTreeWnd, TVM_SELECTITEM, TVGN_CARET, (LPARAM)ht.hItem);
TrackPopupMenu(GetSubMenu(hPopupMenus, PM_TREEVIEW), TPM_RIGHTBUTTON, root = (HTREEITEM)SendMessageW(g_pChildWnd->hTreeWnd, TVM_GETNEXTITEM, TVGN_ROOT, 0);
pt.x, pt.y, 0, hFrameWnd, NULL); TrackPopupMenu(GetSubMenu(hPopupMenus, ht.hItem == root ? PM_COMPUTER : PM_TREEVIEW),
TPM_RIGHTBUTTON, pt.x, pt.y, 0, hFrameWnd, NULL);
} }
break; break;
} }
......
...@@ -37,9 +37,10 @@ ...@@ -37,9 +37,10 @@
#define WM_NOTIFY_REFLECT (WM_USER+1024) #define WM_NOTIFY_REFLECT (WM_USER+1024)
/* Pop-Up Menus */ /* Pop-Up Menus */
#define PM_TREEVIEW 0 #define PM_COMPUTER 0
#define PM_NEW_VALUE 1 #define PM_TREEVIEW 1
#define PM_MODIFY_VALUE 2 #define PM_NEW_VALUE 2
#define PM_MODIFY_VALUE 3
/* HexEdit Class */ /* HexEdit Class */
#define HEM_SETDATA (WM_USER+0) #define HEM_SETDATA (WM_USER+0)
......
...@@ -84,6 +84,13 @@ END ...@@ -84,6 +84,13 @@ END
IDR_POPUP_MENUS MENU IDR_POPUP_MENUS MENU
BEGIN BEGIN
/* PM_COMPUTER */
POPUP ""
BEGIN
MENUITEM "Expand", ID_TREE_EXPAND_COLLAPSE
MENUITEM SEPARATOR
MENUITEM "&Export...", ID_EDIT_EXPORT
END
/* PM_TREEVIEW */ /* PM_TREEVIEW */
POPUP "" POPUP ""
BEGIN BEGIN
......
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