[USER32|WIN32K]

- Convert wParam in WM_*CHAR messages to ANSI in GetMessageA instead of win32k. Fixes wrong characters used in cmake notepad which is ANSI.

svn path=/trunk/; revision=54109
This commit is contained in:
Rafal Harabien 2011-10-13 14:01:01 +00:00
parent 5b1ee500b6
commit 412bc985ed
2 changed files with 25 additions and 9 deletions

View file

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

View file

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