diff --git a/PAiPlayer.rc b/PAiPlayer.rc index bf794f3..f57f5c4 100644 Binary files a/PAiPlayer.rc and b/PAiPlayer.rc differ diff --git a/Resource.h b/Resource.h index 37f7af6..148442e 100644 --- a/Resource.h +++ b/Resource.h @@ -3,15 +3,14 @@ // Used by PAiPlayer.rc // #define IDC_MYICON 2 -#define IDD_EASYAUDIOPLAYER_DIALOG 102 +#define IDD_PAIPLAYER_DIALOG 102 #define IDS_APP_TITLE 103 #define IDD_ABOUTBOX 103 #define IDM_ABOUT 104 #define IDM_EXIT 105 -#define IDI_EASYAUDIOPLAYER 107 #define IDI_PAIPLAYER 107 #define IDI_SMALL 108 -#define IDC_EASYAUDIOPLAYER 109 +#define IDC_PAIPLAYER 109 #define IDR_MAINFRAME 128 #define IDC_MENU 200 #define ID_PLIK_OD32774 32774 diff --git a/main.cpp b/main.cpp index b9a870b..11cf1a5 100644 --- a/main.cpp +++ b/main.cpp @@ -65,6 +65,7 @@ int WINAPI WinMain(HINSTANCE currentInst, HINSTANCE previousInst, LPSTR lpCmdLin if (!RegisterClassEx(&windowClass)) { return 1; } + HACCEL shortcuts = LoadAccelerators(currentInst, MAKEINTRESOURCE(IDC_PAIPLAYER)); menuBar = LoadMenu(currentInst, (LPCWSTR)IDC_MENU); mainWindow = EzCreateWindow(windowClass,currentInst,PROGRAM_NAME, WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX, 400, 620, NULL, menuBar); SendMessage(mainWindow, WM_SETFONT, (WPARAM)hFont, TRUE); @@ -73,8 +74,10 @@ int WINAPI WinMain(HINSTANCE currentInst, HINSTANCE previousInst, LPSTR lpCmdLin UpdateWindow(mainWindow); while (GetMessage(&msg, NULL, 0, 0)) { - TranslateMessage(&msg); - DispatchMessage(&msg); + if (!TranslateAccelerator(msg.hwnd, shortcuts, &msg)) { + TranslateMessage(&msg); + DispatchMessage(&msg); + } } return 0; @@ -245,7 +248,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { } } - switch (wParam) { + switch (windowId) { case IDM_EXIT: SendMessage(mainWindow, WM_CLOSE, NULL, NULL); break;