mirror of
https://github.com/reactos/reactos.git
synced 2024-06-28 08:51:29 +00:00
- Make the "Exit" string translateable
- Use the last possible ID for this command, so we can add as many keyboard layouts as possible to the popup menu - Send a WM_CLOSE message when clicking "Exit", don't duplicate the WM_DESTROY code here svn path=/trunk/; revision=33079
This commit is contained in:
parent
ae6a3c787b
commit
af30d3067b
|
@ -137,6 +137,7 @@ BuildPopupMenu()
|
|||
HMENU hMenu;
|
||||
HKEY hKey;
|
||||
DWORD dwIndex, dwSize;
|
||||
LPTSTR szExit;
|
||||
TCHAR szLayoutNum[CCH_ULONG_DEC + 1];
|
||||
TCHAR szName[MAX_PATH];
|
||||
|
||||
|
@ -159,8 +160,9 @@ BuildPopupMenu()
|
|||
RegCloseKey(hKey);
|
||||
}
|
||||
|
||||
AppendMenu(hMenu, MF_SEPARATOR, 0, _T(""));
|
||||
AppendMenu(hMenu, MF_STRING, 1000, _T("Exit"));
|
||||
LoadString(hInst, IDS_EXIT, (LPTSTR)&szExit, 0);
|
||||
AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);
|
||||
AppendMenu(hMenu, MF_STRING, MENU_ID_EXIT, szExit);
|
||||
|
||||
return hMenu;
|
||||
}
|
||||
|
@ -194,16 +196,11 @@ WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
|
|||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
if (LOWORD(wParam) == 1000)
|
||||
{
|
||||
DestroyMenu(hPopupMenu);
|
||||
DelTrayIcon(hwnd);
|
||||
PostQuitMessage(0);
|
||||
}
|
||||
if (LOWORD(wParam) == MENU_ID_EXIT)
|
||||
SendMessage(hwnd, WM_CLOSE, 0, 0);
|
||||
else
|
||||
{
|
||||
ActivateLayout(LOWORD(wParam));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
|
|
|
@ -9,3 +9,5 @@
|
|||
|
||||
// Maximum Character Count of a ULONG in decimal
|
||||
#define CCH_ULONG_DEC 10
|
||||
|
||||
#define MENU_ID_EXIT 65535
|
||||
|
|
|
@ -3,4 +3,11 @@
|
|||
|
||||
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||
|
||||
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Keyboard Layout Switcher\0"
|
||||
#define REACTOS_STR_INTERNAL_NAME "kbswitch\0"
|
||||
#define REACTOS_STR_ORIGINAL_FILENAME "kbswitch.exe\0"
|
||||
#include <reactos/version.rc>
|
||||
|
||||
IDI_MAIN ICON "res/kbswitch.ico"
|
||||
|
||||
#include "rsrc.rc"
|
||||
|
|
6
reactos/base/applications/kbswitch/lang/de-DE.rc
Normal file
6
reactos/base/applications/kbswitch/lang/de-DE.rc
Normal file
|
@ -0,0 +1,6 @@
|
|||
LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_EXIT, "Beenden"
|
||||
END
|
6
reactos/base/applications/kbswitch/lang/en-US.rc
Normal file
6
reactos/base/applications/kbswitch/lang/en-US.rc
Normal file
|
@ -0,0 +1,6 @@
|
|||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_EXIT, "Exit"
|
||||
END
|
|
@ -1,2 +1,5 @@
|
|||
/* Icons */
|
||||
#define IDI_MAIN 100
|
||||
|
||||
/* Strings */
|
||||
#define IDS_EXIT 1001
|
||||
|
|
2
reactos/base/applications/kbswitch/rsrc.rc
Normal file
2
reactos/base/applications/kbswitch/rsrc.rc
Normal file
|
@ -0,0 +1,2 @@
|
|||
#include "lang/de-DE.rc"
|
||||
#include "lang/en-US.rc"
|
Loading…
Reference in a new issue