Package Manager: fixed HotKeys (thanks to w3seek) *shamed*
[reactos.git] / rosapps / packmgr / gui / main.cpp
index eb06779..7e33cca 100644 (file)
@@ -67,8 +67,11 @@ int WINAPI WinMain (HINSTANCE hinst, HINSTANCE hPrevInstance, PSTR szCmdLine, in
        // Start getting messages\r
        while(GetMessage(&msg,NULL,0,0))\r
        {\r
-         TranslateMessage(&msg);\r
-         DispatchMessage(&msg);\r
+               if(!TranslateAccelerator(hwnd, hHotKeys, &msg))\r
+               {\r
+                       TranslateMessage(&msg);\r
+                       DispatchMessage(&msg);\r
+               }\r
        }\r
        \r
        // Close our handle\r
@@ -152,11 +155,7 @@ void InitControls (HWND hwnd)
        ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(10))); \r
 \r
        // Setup Hotkeys\r
-       RegisterHotKey(hwnd, 1, MOD_CONTROL, VK_1);\r
-       RegisterHotKey(hwnd, 2, MOD_CONTROL, VK_2);\r
-       RegisterHotKey(hwnd, 3, MOD_CONTROL, VK_3);\r
-       RegisterHotKey(hwnd, 4, MOD_CONTROL, VK_4);\r
-       RegisterHotKey(hwnd, 0, MOD_CONTROL, VK_0);\r
+       hHotKeys = LoadAccelerators (hinst, MAKEINTRESOURCE(IDR_HOTKEYS));\r
 }\r
 \r
 // Set the Icons\r