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
This commit is contained in:
Hermès Bélusca-Maïto 2016-07-11 01:57:47 +00:00
parent 3d32d3faaf
commit b9a5fd8135
4 changed files with 6 additions and 6 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);
}