Package Manager: fixed HotKeys (thanks to w3seek) *shamed*
Modified: trunk/rosapps/packmgr/gui/generic.rc
Modified: trunk/rosapps/packmgr/gui/main.cpp
Modified: trunk/rosapps/packmgr/gui/main.h
Modified: trunk/rosapps/packmgr/gui/resource.h
_____
Modified: trunk/rosapps/packmgr/gui/generic.rc
--- trunk/rosapps/packmgr/gui/generic.rc 2005-04-11 18:45:48 UTC
(rev 14591)
+++ trunk/rosapps/packmgr/gui/generic.rc 2005-04-11 20:27:20 UTC
(rev 14592)
@@ -22,3 +22,13 @@
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
_____
Modified: trunk/rosapps/packmgr/gui/main.cpp
--- trunk/rosapps/packmgr/gui/main.cpp 2005-04-11 18:45:48 UTC (rev
14591)
+++ trunk/rosapps/packmgr/gui/main.cpp 2005-04-11 20:27:20 UTC (rev
14592)
@@ -67,8 +67,11 @@
// 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 @@
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
_____
Modified: trunk/rosapps/packmgr/gui/main.h
--- trunk/rosapps/packmgr/gui/main.h 2005-04-11 18:45:48 UTC (rev
14591)
+++ trunk/rosapps/packmgr/gui/main.h 2005-04-11 20:27:20 UTC (rev
14592)
@@ -19,6 +19,7 @@
pTree tree;
HMENU hPopup;
+HACCEL hHotKeys;
HWND hTBar, hTree, hEdit, hStatus;
HTREEITEM nodes [MAXNODES];
_____
Modified: trunk/rosapps/packmgr/gui/resource.h
--- trunk/rosapps/packmgr/gui/resource.h 2005-04-11 18:45:48 UTC
(rev 14591)
+++ trunk/rosapps/packmgr/gui/resource.h 2005-04-11 20:27:20 UTC
(rev 14592)
@@ -12,3 +12,4 @@
#define IDC_STATUS2 0x111
#define IDC_CANCEL 0x112
#define IDC_TSTATUS 0x113
+#define IDR_HOTKEYS 0x114