Changeset 10607 for trunk/src/user32/windowmsg.cpp
- Timestamp:
- May 24, 2004, 11:02:01 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/windowmsg.cpp
r10602 r10607 1 /* $Id: windowmsg.cpp,v 1.5 0 2004-05-11 09:08:20sandervl Exp $ */1 /* $Id: windowmsg.cpp,v 1.51 2004-05-24 09:02:01 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window message APIs for OS/2 … … 34 34 #define INCL_TIMERWIN32 35 35 #include "timer.h" 36 #include "callwrap.h"37 36 38 37 #define DBG_LOCALLOG DBG_windowmsg … … 327 326 * @author knut st. osmundsen <bird-srcspam@anduin.net> 328 327 * @remark One cannot attach a threads input queue to it self. 329 * @remark This implemenation requires the thread which input is 'forwarded' to330 * process it's message queue. Window (and wine) will not bother that thread331 * at all with the messages. (DEADLOCK WARNING)332 328 * @todo Not sure if all this is 100% ok according to the windows reality. 333 329 * I'm sure some error cases aren't caught. … … 566 562 case WM_IME_CHAR: 567 563 { 568 // always DBCS char569 564 CHAR charA[ 2 ]; 570 571 charA[ 0 ] = ( CHAR )( *pwparam >> 8 ); 572 charA[ 1 ] = ( CHAR )*pwparam; 573 574 MultiByteToWideChar( CP_ACP, 0, ( LPSTR )charA, 2, ( LPWSTR )pwparam, 1); 565 INT lenA = 1; 566 567 if( IsDBCSLeadByte(( CHAR )( *pwparam >> 8 ))) 568 { 569 charA[ 0 ] = ( CHAR )( *pwparam >> 8 ); 570 charA[ 1 ] = ( CHAR )*pwparam; 571 lenA = 2; 572 } 573 else 574 charA[ 0 ] = ( CHAR )*pwparam; 575 576 MultiByteToWideChar( CP_ACP, 0, ( LPSTR )charA, lenA, ( LPWSTR )pwparam, 1); 575 577 576 578 return 0; … … 857 859 #ifdef __WIN32OS2__ 858 860 case WM_IME_CHAR: 859 { // always DBCS char861 { 860 862 CHAR charA[ 2 ]; 861 862 WideCharToMultiByte( CP_ACP, 0, ( LPWSTR )pwparam, 1, ( LPSTR )charA, 2, 0, 0 ); 863 *pwparam = ( charA[ 0 ] << 8 ) | charA[ 1 ]; 863 INT lenA; 864 865 lenA = WideCharToMultiByte( CP_ACP, 0, ( LPWSTR )pwparam, 1, ( LPSTR )charA, 2, 0, 0 ); 866 if( lenA > 1 ) 867 *pwparam = ( charA[ 0 ] << 8 ) | charA[ 1 ]; 868 else 869 *pwparam = charA[ 0 ]; 864 870 865 871 return 0; … … 1003 1009 { 1004 1010 LRESULT result; 1011 LPARAM old = lParam; 1005 1012 1006 1013 if (WINPROC_MapMsg32ATo32W( hwnd, msg, &wParam, &lParam ) == -1) return 0; 1007 1014 1008 result = WrapCallback4(func,hwnd, msg, wParam, lParam );1015 result = func( hwnd, msg, wParam, lParam ); 1009 1016 WINPROC_UnmapMsg32ATo32W( hwnd, msg, wParam, lParam ); 1010 1017 … … 1017 1024 { 1018 1025 LPWSTR ustr = ( LPWSTR )HeapAlloc( GetProcessHeap(), 0, ( result + 1 ) * sizeof( WCHAR )); 1019 result = WrapCallback4(func,hwnd, WM_GETTEXT, ( WPARAM )( result + 1 ), ( LPARAM )ustr );1026 result = func( hwnd, WM_GETTEXT, ( WPARAM )( result + 1 ), ( LPARAM )ustr ); 1020 1027 result = lstrlenWtoA( ustr, result ); 1021 1028 HeapFree( GetProcessHeap(), 0, ustr ); … … 1026 1033 { 1027 1034 LPWSTR ustr = ( LPWSTR )HeapAlloc( GetProcessHeap(), 0, ( result + 1 ) * sizeof( WCHAR )); 1028 result = WrapCallback4(func,hwnd, LB_GETTEXT, wParam, ( LPARAM )ustr );1035 result = func( hwnd, LB_GETTEXT, wParam, ( LPARAM )ustr ); 1029 1036 if( result != LB_ERR ) 1030 1037 result = lstrlenWtoA( ustr, result ); … … 1038 1045 { 1039 1046 LPWSTR ustr = ( LPWSTR )HeapAlloc( GetProcessHeap(), 0, ( result + 1 ) * sizeof( WCHAR )); 1040 result = WrapCallback4(func,hwnd, CB_GETLBTEXT, wParam, ( LPARAM )ustr );1047 result = func( hwnd, CB_GETLBTEXT, wParam, ( LPARAM )ustr ); 1041 1048 if( result != CB_ERR ) 1042 1049 result = lstrlenWtoA( ustr, result ); … … 1064 1071 if (WINPROC_MapMsg32WTo32A( hwnd, msg, &wParam, &lParam ) == -1) return 0; 1065 1072 1066 result = WrapCallback4(func,hwnd, msg, wParam, lParam );1073 result = func( hwnd, msg, wParam, lParam ); 1067 1074 WINPROC_UnmapMsg32WTo32A( hwnd, msg, wParam, lParam ); 1068 1075 … … 1075 1082 { 1076 1083 LPSTR astr = ( LPSTR )HeapAlloc( GetProcessHeap(), 0, result + 1 ); 1077 result = WrapCallback4(func,hwnd, WM_GETTEXT, ( WPARAM )( result + 1 ), ( LPARAM )astr );1084 result = func( hwnd, WM_GETTEXT, ( WPARAM )( result + 1 ), ( LPARAM )astr ); 1078 1085 result = lstrlenAtoW( astr, result ); 1079 1086 HeapFree( GetProcessHeap(), 0, astr ); … … 1084 1091 { 1085 1092 LPSTR astr = ( LPSTR )HeapAlloc( GetProcessHeap(), 0, result + 1 ); 1086 result = WrapCallback4(func,hwnd, LB_GETTEXT, wParam, ( LPARAM )astr );1093 result = func( hwnd, LB_GETTEXT, wParam, ( LPARAM )astr ); 1087 1094 if( result != LB_ERR ) 1088 1095 result = lstrlenAtoW( astr, result ); … … 1096 1103 { 1097 1104 LPSTR astr = ( LPSTR )HeapAlloc( GetProcessHeap(), 0, result + 1 ); 1098 result = WrapCallback4(func,hwnd, CB_GETLBTEXT, wParam, ( LPARAM )astr );1105 result = func( hwnd, CB_GETLBTEXT, wParam, ( LPARAM )astr ); 1099 1106 if( result != CB_ERR ) 1100 1107 result = lstrlenAtoW( astr, result );
Note:
See TracChangeset
for help on using the changeset viewer.