Commit 4dc5a764 authored by Hugh McMaster's avatar Hugh McMaster Committed by Alexandre Julliard

regedit: Call TrackPopupMenu() from WM_CONTEXTMENU.

parent 583255f2
...@@ -292,6 +292,9 @@ static void set_last_key(HWND hwndTV) ...@@ -292,6 +292,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) * FUNCTION: ChildWndProc(HWND, unsigned, WORD, LONG)
...@@ -368,6 +371,12 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa ...@@ -368,6 +371,12 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
draw_splitbar(hWnd, last_split); draw_splitbar(hWnd, last_split);
break; 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: case WM_KEYDOWN:
if (wParam == VK_ESCAPE) if (wParam == VK_ESCAPE)
if (GetCapture() == hWnd) { if (GetCapture() == hWnd) {
...@@ -419,13 +428,6 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa ...@@ -419,13 +428,6 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
case NM_SETFOCUS: case NM_SETFOCUS:
g_pChildWnd->nFocusPanel = 0; g_pChildWnd->nFocusPanel = 0;
break; 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: { case TVN_BEGINLABELEDITW: {
HKEY hRootKey; HKEY hRootKey;
LPWSTR path; LPWSTR path;
......
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