"Phil Krylov" <phil(a)newstar.rinet.ru> wrote:
One solution
is to translate the whole wparam.
How do you see it? Example: I do a
PostMessageA(hwndAnsi, WM_CHAR, 0xF301, 0);
map_wparam_AtoW takes the "\x01\xF3" string, translates it to Unicode via
CP_ACP (for CP1251, this would be probably {'\x01', 0x443})... and how
does it fit this info back in LOWORD(wParam)?
The key word is "the whole" wparam. So, there is no need to truncate it
by using LOWORD.
AFAIK in DBCS two separate messages are used.
A test under Windows would say it for sure.
I can't test it as I don't have a Windows with DBCS locales installed,
Just install one of such locales then, NT/2k/XP have built-in support
for DBCS locales.
but
Internet says:
When entering non-ASCII characters on systems
with DBCS input
locales, the lead byte and trail byte for the DBCS character are
passed
in two successive WM_CHAR messages. So we are better off processing
WM_IME_CHAR messages because we get both bytes at once. If we move to
Unicode, however, we'll directly get UTF-16 in WM_CHAR; or on XP: UTF-32
in WM_UNICHAR.
Again, without a test we can't tell for sure what happens in reality.
--
Dmitry.