Package Manager: fixed HotKeys (thanks to w3seek) *shamed*

svn path=/trunk/rosapps/packmgr/; revision=19
This commit is contained in:
Maarten Bosma 2005-04-11 20:27:20 +00:00
parent 3d51d50fd3
commit 3c5a322cee
4 changed files with 18 additions and 7 deletions

View File

@ -22,3 +22,13 @@ IDB_TOOLBAR BITMAP DISCARDABLE "res/toolbar.bmp"
13 ICON DISCARDABLE "res/update.ico"
14 ICON DISCARDABLE "res/uninstall.ico"
/* HotKeys */
IDR_HOTKEYS ACCELERATORS DISCARDABLE
BEGIN
"1", 2, VIRTKEY, CONTROL
"2", 3, VIRTKEY, CONTROL
"3", 4, VIRTKEY, CONTROL
"4", 5, VIRTKEY, CONTROL
"0", 1, VIRTKEY, CONTROL
END

View File

@ -67,8 +67,11 @@ int WINAPI WinMain (HINSTANCE hinst, HINSTANCE hPrevInstance, PSTR szCmdLine, in
// Start getting messages
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
if(!TranslateAccelerator(hwnd, hHotKeys, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
// Close our handle
@ -152,11 +155,7 @@ void InitControls (HWND hwnd)
ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(10)));
// Setup Hotkeys
RegisterHotKey(hwnd, 1, MOD_CONTROL, VK_1);
RegisterHotKey(hwnd, 2, MOD_CONTROL, VK_2);
RegisterHotKey(hwnd, 3, MOD_CONTROL, VK_3);
RegisterHotKey(hwnd, 4, MOD_CONTROL, VK_4);
RegisterHotKey(hwnd, 0, MOD_CONTROL, VK_0);
hHotKeys = LoadAccelerators (hinst, MAKEINTRESOURCE(IDR_HOTKEYS));
}
// Set the Icons

View File

@ -19,6 +19,7 @@ int selected, splitter_pos = 50;
pTree tree;
HMENU hPopup;
HACCEL hHotKeys;
HWND hTBar, hTree, hEdit, hStatus;
HTREEITEM nodes [MAXNODES];

View File

@ -12,3 +12,4 @@
#define IDC_STATUS2 0x111
#define IDC_CANCEL 0x112
#define IDC_TSTATUS 0x113
#define IDR_HOTKEYS 0x114