Author: rharabien
Date: Thu Oct 13 14:01:01 2011
New Revision: 54109
URL:
http://svn.reactos.org/svn/reactos?rev=54109&view=rev
Log:
[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.
Modified:
trunk/reactos/dll/win32/user32/windows/message.c
trunk/reactos/subsystems/win32/win32k/ntuser/keyboard.c
Modified: trunk/reactos/dll/win32/user32/windows/message.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/m…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/message.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/message.c [iso-8859-1] Thu Oct 13 14:01:01
2011
@@ -1703,6 +1703,28 @@
}
+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
*/
@@ -1725,6 +1747,8 @@
{
return Res;
}
+
+ IntConvertMsgToAnsi(lpMsg);
return Res;
}
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/keyboard.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/keyboard.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/keyboard.c [iso-8859-1] Thu Oct 13
14:01:01 2011
@@ -1030,15 +1030,7 @@
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;