]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
UI tweak from Malcolm Rowe: set IDM_VIEWKEYS as the default menu item and use
authorJacob Nevins <jacobn@chiark.greenend.org.uk>
Sat, 20 Nov 2004 18:29:58 +0000 (18:29 +0000)
committerJacob Nevins <jacobn@chiark.greenend.org.uk>
Sat, 20 Nov 2004 18:29:58 +0000 (18:29 +0000)
that mechanism to invoke it on double-click; this emboldens it in the right-
click menu.

[originally from svn r4851]

windows/winpgnt.c

index 1c34d71cb1437c0368b7a692949977cf3449c36c..209c7c6936c7ac085d2e06fff5b4d4bd80408a57 100644 (file)
@@ -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);
 
        /*