keyboard shortcuts

This commit is contained in:
mmacierzanka committed 2021-05-29 21:39:22 +02:00
1 parent 447dbfb743
commit e7ef2d7eaf
3 files changed
+8 -6

No files matched your search

BIN
View File
Binary file not shown.
+2 -3
View File
@@ -3,15 +3,14 @@
// Used by PAiPlayer.rc // Used by PAiPlayer.rc
// //
#define IDC_MYICON 2 #define IDC_MYICON 2
#define IDD_EASYAUDIOPLAYER_DIALOG 102 #define IDD_PAIPLAYER_DIALOG 102
#define IDS_APP_TITLE 103 #define IDS_APP_TITLE 103
#define IDD_ABOUTBOX 103 #define IDD_ABOUTBOX 103
#define IDM_ABOUT 104 #define IDM_ABOUT 104
#define IDM_EXIT 105 #define IDM_EXIT 105
#define IDI_EASYAUDIOPLAYER 107
#define IDI_PAIPLAYER 107 #define IDI_PAIPLAYER 107
#define IDI_SMALL 108 #define IDI_SMALL 108
#define IDC_EASYAUDIOPLAYER 109 #define IDC_PAIPLAYER 109
#define IDR_MAINFRAME 128 #define IDR_MAINFRAME 128
#define IDC_MENU 200 #define IDC_MENU 200
#define ID_PLIK_OD32774 32774 #define ID_PLIK_OD32774 32774
+6 -3
View File
@@ -65,6 +65,7 @@ int WINAPI WinMain(HINSTANCE currentInst, HINSTANCE previousInst, LPSTR lpCmdLin
if (!RegisterClassEx(&windowClass)) { if (!RegisterClassEx(&windowClass)) {
return 1; return 1;
} }
HACCEL shortcuts = LoadAccelerators(currentInst, MAKEINTRESOURCE(IDC_PAIPLAYER));
menuBar = LoadMenu(currentInst, (LPCWSTR)IDC_MENU); menuBar = LoadMenu(currentInst, (LPCWSTR)IDC_MENU);
mainWindow = EzCreateWindow(windowClass,currentInst,PROGRAM_NAME, WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX, 400, 620, NULL, menuBar); 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); SendMessage(mainWindow, WM_SETFONT, (WPARAM)hFont, TRUE);
@@ -73,8 +74,10 @@ int WINAPI WinMain(HINSTANCE currentInst, HINSTANCE previousInst, LPSTR lpCmdLin
UpdateWindow(mainWindow); UpdateWindow(mainWindow);
while (GetMessage(&msg, NULL, 0, 0)) { while (GetMessage(&msg, NULL, 0, 0)) {
TranslateMessage(&msg); if (!TranslateAccelerator(msg.hwnd, shortcuts, &msg)) {
DispatchMessage(&msg); TranslateMessage(&msg);
DispatchMessage(&msg);
}
} }
return 0; return 0;
@@ -245,7 +248,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
} }
} }
switch (wParam) { switch (windowId) {
case IDM_EXIT: case IDM_EXIT:
SendMessage(mainWindow, WM_CLOSE, NULL, NULL); SendMessage(mainWindow, WM_CLOSE, NULL, NULL);
break; break;