From b9a5fd813532fed6dc6998bf543c8dd12ee64566 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 11 Jul 2016 01:57:47 +0000 Subject: [PATCH 1/1] Fix usage of the first parameter for TranslateAccelerator: this should be the handle of the window that will receive the accelerator commands (not the window from which the message originates). svn path=/trunk/; revision=71893 --- reactos/base/applications/magnify/magnifier.c | 4 ++-- reactos/base/applications/sndrec32/sndrec32.cpp | 2 +- reactos/boot/freeldr/fdebug/fdebug.c | 2 +- rosapps/templates/dialog/dialog.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/reactos/base/applications/magnify/magnifier.c b/reactos/base/applications/magnify/magnifier.c index 951328723b1..79c3f914b55 100644 --- a/reactos/base/applications/magnify/magnifier.c +++ b/reactos/base/applications/magnify/magnifier.c @@ -71,7 +71,7 @@ INT_PTR CALLBACK AboutProc(HWND, UINT, WPARAM, LPARAM); INT_PTR CALLBACK OptionsProc(HWND, UINT, WPARAM, LPARAM); INT_PTR CALLBACK WarningProc(HWND, UINT, WPARAM, LPARAM); -int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { MSG msg; HACCEL hAccelTable; @@ -102,7 +102,7 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin /* Main message loop */ while (GetMessage(&msg, NULL, 0, 0)) { - if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) + if (!TranslateAccelerator(hMainWnd, hAccelTable, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); diff --git a/reactos/base/applications/sndrec32/sndrec32.cpp b/reactos/base/applications/sndrec32/sndrec32.cpp index d586f644364..18e23d15269 100644 --- a/reactos/base/applications/sndrec32/sndrec32.cpp +++ b/reactos/base/applications/sndrec32/sndrec32.cpp @@ -211,7 +211,7 @@ _tWinMain(HINSTANCE hInstance, /* Starts main loop */ while (GetMessage(&msg, NULL, 0, 0)) { - if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) + if (!TranslateAccelerator(main_win, hAccelTable, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); diff --git a/reactos/boot/freeldr/fdebug/fdebug.c b/reactos/boot/freeldr/fdebug/fdebug.c index 9db43a879da..4f8e7f097ea 100644 --- a/reactos/boot/freeldr/fdebug/fdebug.c +++ b/reactos/boot/freeldr/fdebug/fdebug.c @@ -67,7 +67,7 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, // Main message loop: while (GetMessage(&msg, NULL, 0, 0)) { - if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) + if (!TranslateAccelerator(hMainWnd, hAccelTable, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); diff --git a/rosapps/templates/dialog/dialog.c b/rosapps/templates/dialog/dialog.c index 4f3c3902bfa..b17413e9629 100644 --- a/rosapps/templates/dialog/dialog.c +++ b/rosapps/templates/dialog/dialog.c @@ -196,8 +196,8 @@ int APIENTRY WinMain(HINSTANCE hInstance, instData.hWnd = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_TABBED_DIALOG), NULL, (DLGPROC)DlgProc, (LPARAM)&instData); ShowWindow(instData.hWnd, SW_SHOW); hAccel = LoadAccelerators(hInst, (LPCTSTR)IDR_ACCELERATOR); - while (GetMessage(&msg, (HWND)NULL, 0, 0)) { - if (!TranslateAccelerator(msg.hwnd, hAccel, &msg)) { + while (GetMessage(&msg, NULL, 0, 0)) { + if (!TranslateAccelerator(instData.hWnd, hAccel, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } -- 2.17.1