Commit 109d15ab authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

user32: Map WM_CHAR wparam in ASCII to Unicode in IsDialogMessageA() for CJK locales.

Fix displaying Chinese characters as "??" in some applications with Chinese locale.
parent fe594a83
......@@ -814,8 +814,12 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetMessageA( MSG *msg, HWND hwnd, UINT first, UINT
*/
BOOL WINAPI IsDialogMessageA( HWND hwndDlg, LPMSG pmsg )
{
enum wm_char_mapping mapping;
MSG msg = *pmsg;
map_wparam_AtoW( msg.message, &msg.wParam, WMCHAR_MAP_NOMAPPING );
mapping = GetSystemMetrics( SM_DBCSENABLED ) ? WMCHAR_MAP_ISDIALOGMESSAGE : WMCHAR_MAP_NOMAPPING;
if (!map_wparam_AtoW( msg.message, &msg.wParam, mapping ))
return TRUE;
return IsDialogMessageW( hwndDlg, &msg );
}
......
......@@ -575,10 +575,7 @@ static LRESULT CALLBACK test_IsDialogMessageA_proc(HWND hwnd, UINT msg, WPARAM w
{
case WM_CHAR:
if (GetSystemMetrics(SM_DBCSENABLED))
{
todo_wine
ok(wparam == 0x5b57, "Got unexpected wparam %#Ix.\n", wparam);
}
else
ok(wparam == 0x3f, "Got unexpected wparam %#Ix.\n", wparam);
wm_char_count++;
......@@ -879,7 +876,6 @@ static void test_IsDialogMessage(void)
DispatchMessageA(&msg);
}
}
todo_wine_if(GetSystemMetrics(SM_DBCSENABLED))
ok(wm_char_count == 1, "Got unexpected WM_CHAR count %d.\n", wm_char_count);
DestroyWindow(g_hwndMain);
}
......
......@@ -135,6 +135,7 @@ enum wm_char_mapping
WMCHAR_MAP_RECVMESSAGE,
WMCHAR_MAP_DISPATCHMESSAGE,
WMCHAR_MAP_CALLWINDOWPROC,
WMCHAR_MAP_ISDIALOGMESSAGE,
WMCHAR_MAP_COUNT,
WMCHAR_MAP_NOMAPPING = WMCHAR_MAP_COUNT
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment