[PATCH 4/4] regedit: Only show the context menu if the mouse is over a treeitem

Hugh McMaster hugh.mcmaster at outlook.com
Mon Apr 17 04:15:46 CDT 2017


Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
 programs/regedit/childwnd.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/programs/regedit/childwnd.c b/programs/regedit/childwnd.c
index df7c640..6ee0cdb 100644
--- a/programs/regedit/childwnd.c
+++ b/programs/regedit/childwnd.c
@@ -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:
-- 
2.7.4




More information about the wine-patches mailing list