mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 15:26:02 +00:00
- The division of right and the left menu
- Fix formatting in translations svn path=/trunk/; revision=33231
This commit is contained in:
parent
3a8f1dc806
commit
f593891576
4 changed files with 29 additions and 12 deletions
|
@ -272,14 +272,11 @@ ActivateLayout(HWND hwnd, ULONG uLayoutNum)
|
|||
}
|
||||
|
||||
static HMENU
|
||||
BuildPopupMenu()
|
||||
BuildLeftPopupMenu()
|
||||
{
|
||||
HMENU hMenu;
|
||||
HMENU hMenuTemplate;
|
||||
HKEY hKey;
|
||||
DWORD dwIndex, dwSize;
|
||||
LPTSTR pszMenuItem;
|
||||
MENUITEMINFO mii;
|
||||
TCHAR szLayoutNum[CCH_ULONG_DEC + 1];
|
||||
TCHAR szName[MAX_PATH];
|
||||
|
||||
|
@ -303,6 +300,21 @@ BuildPopupMenu()
|
|||
RegCloseKey(hKey);
|
||||
}
|
||||
|
||||
return hMenu;
|
||||
}
|
||||
|
||||
static HMENU
|
||||
BuildRightPopupMenu()
|
||||
{
|
||||
HMENU hMenu;
|
||||
HMENU hMenuTemplate;
|
||||
DWORD dwIndex;
|
||||
LPTSTR pszMenuItem;
|
||||
MENUITEMINFO mii;
|
||||
|
||||
// Add the keyboard layouts to the popup menu
|
||||
hMenu = BuildLeftPopupMenu();
|
||||
|
||||
// Add the menu items from the popup menu template
|
||||
hMenuTemplate = GetSubMenu(LoadMenu(hInst, MAKEINTRESOURCE(IDR_POPUP)), 0);
|
||||
dwIndex = 0;
|
||||
|
@ -340,26 +352,30 @@ BuildPopupMenu()
|
|||
LRESULT CALLBACK
|
||||
WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
static HMENU hPopupMenu;
|
||||
static HMENU hLeftPopupMenu, hRightPopupMenu;
|
||||
|
||||
switch (Message)
|
||||
{
|
||||
case WM_CREATE:
|
||||
AddTrayIcon(hwnd);
|
||||
hPopupMenu = BuildPopupMenu(hwnd);
|
||||
hLeftPopupMenu = BuildLeftPopupMenu(hwnd);
|
||||
hRightPopupMenu = BuildRightPopupMenu(hwnd);
|
||||
break;
|
||||
|
||||
case WM_NOTIFYICONMSG:
|
||||
switch (lParam)
|
||||
{
|
||||
case WM_LBUTTONDOWN:
|
||||
case WM_RBUTTONDOWN:
|
||||
case WM_LBUTTONDOWN:
|
||||
{
|
||||
POINT pt;
|
||||
|
||||
GetCursorPos(&pt);
|
||||
SetForegroundWindow(hwnd);
|
||||
TrackPopupMenu(hPopupMenu, 0, pt.x, pt.y, 0, hwnd, NULL);
|
||||
if (lParam == WM_LBUTTONDOWN)
|
||||
TrackPopupMenu(hLeftPopupMenu, 0, pt.x, pt.y, 0, hwnd, NULL);
|
||||
else
|
||||
TrackPopupMenu(hRightPopupMenu, 0, pt.x, pt.y, 0, hwnd, NULL);
|
||||
PostMessage(hwnd, WM_NULL, 0, 0);
|
||||
break;
|
||||
}
|
||||
|
@ -396,7 +412,8 @@ WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
|
|||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
DestroyMenu(hPopupMenu);
|
||||
DestroyMenu(hLeftPopupMenu);
|
||||
DestroyMenu(hRightPopupMenu);
|
||||
DelTrayIcon(hwnd);
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
|
|
@ -11,6 +11,6 @@ BEGIN
|
|||
BEGIN
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Pøedvolby...", ID_PREFERENCES
|
||||
MENUITEM "&Ukonèit", ID_EXIT
|
||||
MENUITEM "&Ukonèit", ID_EXIT
|
||||
END
|
||||
END
|
||||
|
|
|
@ -6,6 +6,6 @@ BEGIN
|
|||
BEGIN
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Préférences...", ID_PREFERENCES
|
||||
MENUITEM "Quitt&er", ID_EXIT
|
||||
MENUITEM "Quitt&er", ID_EXIT
|
||||
END
|
||||
END
|
||||
|
|
|
@ -13,6 +13,6 @@ BEGIN
|
|||
BEGIN
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Ustawienia...", ID_PREFERENCES
|
||||
MENUITEM "&Wyjście", ID_EXIT
|
||||
MENUITEM "&Wyjście", ID_EXIT
|
||||
END
|
||||
END
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue