diff --git a/reactos/dll/win32/user32/windows/message.c b/reactos/dll/win32/user32/windows/message.c index b3209b5c37e..ea73945e694 100644 --- a/reactos/dll/win32/user32/windows/message.c +++ b/reactos/dll/win32/user32/windows/message.c @@ -1703,6 +1703,28 @@ DispatchMessageW(CONST MSG *lpmsg) } +static VOID +IntConvertMsgToAnsi(LPMSG lpMsg) +{ + CHAR ch[2]; + WCHAR wch[2]; + + switch (lpMsg->message) + { + case WM_CHAR: + case WM_DEADCHAR: + case WM_SYSCHAR: + case WM_SYSDEADCHAR: + case WM_MENUCHAR: + wch[0] = LOWORD(lpMsg->wParam); + wch[1] = HIWORD(lpMsg->wParam); + ch[0] = ch[1] = 0; + WideCharToMultiByte(CP_THREAD_ACP, 0, wch, 2, ch, 2, NULL, NULL); + lpMsg->wParam = MAKEWPARAM(ch[0] | (ch[1] << 8), 0); + break; + } +} + /* * @implemented */ @@ -1726,6 +1748,8 @@ GetMessageA(LPMSG lpMsg, return Res; } + IntConvertMsgToAnsi(lpMsg); + return Res; } diff --git a/reactos/subsystems/win32/win32k/ntuser/keyboard.c b/reactos/subsystems/win32/win32k/ntuser/keyboard.c index ee9118f81fb..aec40d0066b 100644 --- a/reactos/subsystems/win32/win32k/ntuser/keyboard.c +++ b/reactos/subsystems/win32/win32k/ntuser/keyboard.c @@ -1030,15 +1030,7 @@ IntTranslateKbdMessage(LPMSG lpMsg, for (i = 0; i < cch; ++i) { TRACE("Msg: %x '%lc' (%04x) %08x\n", NewMsg.message, wch[i], wch[i], NewMsg.lParam); - if (pWnd->Unicode) - NewMsg.wParam = wch[i]; - else - { - CHAR ch; - if (!NT_SUCCESS(RtlUnicodeToMultiByteN(&ch, sizeof(ch), NULL, &wch[i], sizeof(wch[i])))) - WARN("RtlUnicodeToMultiByteN failed!\n"); - NewMsg.wParam = ch; - } + NewMsg.wParam = wch[i]; MsqPostMessage(pti->MessageQueue, &NewMsg, FALSE, QS_KEY); } bResult = TRUE;