Added A<->W mappings for WM_IME_CHAR.

This commit is contained in:
Alexandre Julliard 2003-05-11 02:58:19 +00:00
parent ba2ac1337d
commit 17c63bbab3
2 changed files with 93 additions and 23 deletions

View File

@ -187,7 +187,7 @@ static const unsigned int message_unicode_flags[] =
/* 0x260 - 0x27f */
0,
/* 0x280 - 0x29f */
0,
SET(WM_IME_CHAR),
/* 0x2a0 - 0x2bf */
0,
/* 0x2c0 - 0x2df */
@ -325,19 +325,33 @@ static BOOL CALLBACK broadcast_message_callback( HWND hwnd, LPARAM lparam )
*/
static WPARAM map_wparam_AtoW( UINT message, WPARAM wparam )
{
if (message == WM_CHARTOITEM ||
message == EM_SETPASSWORDCHAR ||
message == WM_CHAR ||
message == WM_DEADCHAR ||
message == WM_SYSCHAR ||
message == WM_SYSDEADCHAR ||
message == WM_MENUCHAR)
switch(message)
{
case WM_CHARTOITEM:
case EM_SETPASSWORDCHAR:
case WM_CHAR:
case WM_DEADCHAR:
case WM_SYSCHAR:
case WM_SYSDEADCHAR:
case WM_MENUCHAR:
{
char ch = LOWORD(wparam);
WCHAR wch;
MultiByteToWideChar(CP_ACP, 0, &ch, 1, &wch, 1);
wparam = MAKEWPARAM( wch, HIWORD(wparam) );
}
break;
case WM_IME_CHAR:
{
char ch[2];
WCHAR wch;
ch[0] = (wparam >> 8);
ch[1] = (wparam & 0xff);
MultiByteToWideChar(CP_ACP, 0, ch, 2, &wch, 1);
wparam = MAKEWPARAM( wch, HIWORD(wparam) );
}
break;
}
return wparam;
}
@ -349,18 +363,32 @@ static WPARAM map_wparam_AtoW( UINT message, WPARAM wparam )
*/
static WPARAM map_wparam_WtoA( UINT message, WPARAM wparam )
{
if (message == WM_CHARTOITEM ||
message == EM_SETPASSWORDCHAR ||
message == WM_CHAR ||
message == WM_DEADCHAR ||
message == WM_SYSCHAR ||
message == WM_SYSDEADCHAR ||
message == WM_MENUCHAR)
switch(message)
{
case WM_CHARTOITEM:
case EM_SETPASSWORDCHAR:
case WM_CHAR:
case WM_DEADCHAR:
case WM_SYSCHAR:
case WM_SYSDEADCHAR:
case WM_MENUCHAR:
{
WCHAR wch = LOWORD(wparam);
char ch;
BYTE ch;
WideCharToMultiByte( CP_ACP, 0, &wch, 1, &ch, 1, NULL, NULL );
wparam = MAKEWPARAM( (unsigned char)ch, HIWORD(wparam) );
wparam = MAKEWPARAM( ch, HIWORD(wparam) );
}
break;
case WM_IME_CHAR:
{
WCHAR wch = LOWORD(wparam);
BYTE ch[2];
ch[1] = 0;
WideCharToMultiByte( CP_ACP, 0, &wch, 1, ch, 2, NULL, NULL );
wparam = MAKEWPARAM( (ch[0] << 8) | ch[1], HIWORD(wparam) );
}
break;
}
return wparam;
}

View File

@ -729,6 +729,17 @@ INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM *plpara
}
return 0;
case WM_IME_CHAR:
{
BYTE ch[2];
WCHAR wch;
ch[0] = (*pwparam >> 8);
ch[1] = *pwparam & 0xff;
MultiByteToWideChar(CP_ACP, 0, ch, 2, &wch, 1);
*pwparam = MAKEWPARAM( wch, HIWORD(*pwparam) );
}
return 0;
case WM_PAINTCLIPBOARD:
case WM_SIZECLIPBOARD:
FIXME_(msg)("message %s (0x%x) needs translation, please report\n", SPY_GetMsgName(msg, hwnd), msg );
@ -985,6 +996,17 @@ INT WINPROC_MapMsg32WTo32A( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM *plpara
}
return 0;
case WM_IME_CHAR:
{
WCHAR wch = LOWORD(*pwparam);
BYTE ch[2];
ch[1] = 0;
WideCharToMultiByte( CP_ACP, 0, &wch, 1, ch, 2, NULL, NULL );
*pwparam = MAKEWPARAM( (ch[0] << 8) | ch[1], HIWORD(*pwparam) );
}
return 0;
case WM_PAINTCLIPBOARD:
case WM_SIZECLIPBOARD:
FIXME_(msg)("message %s (%04x) needs translation, please report\n",SPY_GetMsgName(msg, hwnd),msg );
@ -1648,6 +1670,15 @@ INT WINPROC_MapMsg16To32W( HWND hwnd, UINT16 msg16, WPARAM16 wParam16, UINT *pms
MultiByteToWideChar( CP_ACP, 0, &ch, 1, &wch, 1);
*pwparam32 = wch;
return 0;
case WM_IME_CHAR:
{
char ch[2];
ch[0] = (wParam16 >> 8);
ch[1] = wParam16 & 0xff;
MultiByteToWideChar(CP_ACP, 0, ch, 2, &wch, 1);
*pwparam32 = wch;
}
return 0;
default: /* No Unicode translation needed */
return WINPROC_MapMsg16To32A( hwnd, msg16, wParam16, pmsg32,
@ -2504,6 +2535,17 @@ INT WINPROC_MapMsg32WTo16( HWND hwnd, UINT msg32, WPARAM wParam32,
*pwparam16 = ch;
return 0;
case WM_IME_CHAR:
{
BYTE ch[2];
wch = wParam32;
ch[1] = 0;
WideCharToMultiByte( CP_ACP, 0, &wch, 1, ch, 2, NULL, NULL );
*pwparam16 = (ch[0] << 8) | ch[1];
}
return 0;
default: /* No Unicode translation needed (?) */
return WINPROC_MapMsg32ATo16( hwnd, msg32, wParam32, pmsg16,
pwparam16, plparam );