Hugh McMaster : regedit: Call TrackPopupMenu() from WM_CONTEXTMENU.

Alexandre Julliard julliard at winehq.org
Thu Jul 20 12:11:29 CDT 2017


Module: wine
Branch: stable
Commit: d1ea810b28e33aaf5f9efa9fa179aa4da69448ac
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d1ea810b28e33aaf5f9efa9fa179aa4da69448ac

Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date:   Mon Apr 17 09:15:25 2017 +0000

regedit: Call TrackPopupMenu() from WM_CONTEXTMENU.

Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 4dc5a764c781fa50530fcec7baf6a1e53256368c)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 programs/regedit/childwnd.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/programs/regedit/childwnd.c b/programs/regedit/childwnd.c
index 08eeec1..74e30f8 100644
--- a/programs/regedit/childwnd.c
+++ b/programs/regedit/childwnd.c
@@ -283,6 +283,9 @@ static void set_last_key(HWND hwndTV)
     }
 }
 
+#define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp))
+#define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))
+
 /*******************************************************************************
  *
  *  FUNCTION: ChildWndProc(HWND, unsigned, WORD, LONG)
@@ -359,6 +362,12 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
             draw_splitbar(hWnd, last_split);
         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);
+    }
+
     case WM_KEYDOWN:
         if (wParam == VK_ESCAPE)
             if (GetCapture() == hWnd) {
@@ -410,13 +419,6 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
 	    case NM_SETFOCUS:
 		g_pChildWnd->nFocusPanel = 0;
 		break;
-            case NM_RCLICK: {
-		POINT pt;
-                GetCursorPos(&pt);
-		TrackPopupMenu(GetSubMenu(hPopupMenus, PM_NEW),
-			       TPM_RIGHTBUTTON, pt.x, pt.y, 0, hFrameWnd, NULL);
-		break;
-            }
             case TVN_BEGINLABELEDITW: {
                 HKEY hRootKey;
                 LPWSTR path;




More information about the wine-cvs mailing list