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.

[originally from svn r4851]
This commit is contained in:
Jacob Nevins 2004-11-20 18:29:58 +00:00
Родитель 1969da0208
Коммит 693f062397
1 изменённых файлов: 7 добавлений и 2 удалений

Просмотреть файл

@ -1737,8 +1737,10 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
GetCursorPos(&cursorpos); GetCursorPos(&cursorpos);
PostMessage(hwnd, WM_SYSTRAY2, cursorpos.x, cursorpos.y); PostMessage(hwnd, WM_SYSTRAY2, cursorpos.x, cursorpos.y);
} else if (lParam == WM_LBUTTONDBLCLK) { } else if (lParam == WM_LBUTTONDBLCLK) {
/* Equivalent to IDM_VIEWKEYS. */ /* Run the default menu item. */
PostMessage(hwnd, WM_COMMAND, IDM_VIEWKEYS, 0); UINT menuitem = GetMenuDefaultItem(systray_menu, FALSE, 0);
if (menuitem != -1)
PostMessage(hwnd, WM_COMMAND, menuitem, 0);
} }
break; break;
case WM_SYSTRAY2: 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"); AppendMenu(systray_menu, MF_ENABLED, IDM_CLOSE, "E&xit");
initial_menuitems_count = GetMenuItemCount(session_menu); initial_menuitems_count = GetMenuItemCount(session_menu);
/* Set the default menu item. */
SetMenuDefaultItem(systray_menu, IDM_VIEWKEYS, FALSE);
ShowWindow(main_hwnd, SW_HIDE); ShowWindow(main_hwnd, SW_HIDE);
/* /*