From: jacob Date: Sat, 20 Nov 2004 18:29:58 +0000 (+0000) Subject: UI tweak from Malcolm Rowe: set IDM_VIEWKEYS as the default menu item and use X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/45f23490ce0e9e7cb80b46de1be7b0faa25e2366 UI tweak from Malcolm Rowe: set IDM_VIEWKEYS as the default menu item and use that mechanism to invoke it on double-click; this emboldens it in the right- click menu. git-svn-id: svn://svn.tartarus.org/sgt/putty@4851 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/windows/winpgnt.c b/windows/winpgnt.c index 1c34d71c..209c7c69 100644 --- a/windows/winpgnt.c +++ b/windows/winpgnt.c @@ -1737,8 +1737,10 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, GetCursorPos(&cursorpos); PostMessage(hwnd, WM_SYSTRAY2, cursorpos.x, cursorpos.y); } else if (lParam == WM_LBUTTONDBLCLK) { - /* Equivalent to IDM_VIEWKEYS. */ - PostMessage(hwnd, WM_COMMAND, IDM_VIEWKEYS, 0); + /* Run the default menu item. */ + UINT menuitem = GetMenuDefaultItem(systray_menu, FALSE, 0); + if (menuitem != -1) + PostMessage(hwnd, WM_COMMAND, menuitem, 0); } break; case WM_SYSTRAY2: @@ -2116,6 +2118,9 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) AppendMenu(systray_menu, MF_ENABLED, IDM_CLOSE, "E&xit"); initial_menuitems_count = GetMenuItemCount(session_menu); + /* Set the default menu item. */ + SetMenuDefaultItem(systray_menu, IDM_VIEWKEYS, FALSE); + ShowWindow(main_hwnd, SW_HIDE); /*