Fixed IsDialogMessage16.

This commit is contained in:
Ove Kaaven 1998-11-01 15:27:12 +00:00 committed by Alexandre Julliard
parent 8b21f28d53
commit 748acbb0a5
3 changed files with 76 additions and 8 deletions

View file

@ -91,7 +91,7 @@ file user.exe
87 pascal16 DialogBox(word segstr word segptr) DialogBox16
88 pascal16 EndDialog(word s_word) EndDialog16
89 pascal16 CreateDialog(word segstr word segptr) CreateDialog16
90 pascal16 IsDialogMessage(word ptr) IsDialogMessage16
90 pascal16 IsDialogMessage(word segptr) WIN16_IsDialogMessage16
91 pascal16 GetDlgItem(word word) GetDlgItem16
92 pascal16 SetDlgItemText(word word segstr) SetDlgItemText16
93 pascal16 GetDlgItemText(word word segptr word) GetDlgItemText16

View file

@ -1193,16 +1193,16 @@ static BOOL32 DIALOG_IsDialogMessage( HWND32 hwnd, HWND32 hwndDlg,
/***********************************************************************
* IsDialogMessage16 (USER.90)
*/
BOOL16 WINAPI IsDialogMessage16( HWND16 hwndDlg, LPMSG16 msg )
BOOL16 WINAPI WIN16_IsDialogMessage16( HWND16 hwndDlg, SEGPTR msg16 )
{
LPMSG16 msg = PTR_SEG_TO_LIN(msg16);
BOOL32 ret, translate, dispatch;
INT32 dlgCode;
if ((hwndDlg != msg->hwnd) && !IsChild16( hwndDlg, msg->hwnd ))
return FALSE;
dlgCode = SendMessage16( msg->hwnd, WM_GETDLGCODE, 0, (LPARAM)msg);
dlgCode = SendMessage16( msg->hwnd, WM_GETDLGCODE, 0, (LPARAM)msg16);
ret = DIALOG_IsDialogMessage( msg->hwnd, hwndDlg, msg->message,
msg->wParam, msg->lParam,
&translate, &dispatch, dlgCode );
@ -1212,6 +1212,17 @@ BOOL16 WINAPI IsDialogMessage16( HWND16 hwndDlg, LPMSG16 msg )
}
BOOL16 WINAPI IsDialogMessage16( HWND16 hwndDlg, LPMSG16 msg )
{
LPMSG16 msg16 = SEGPTR_NEW(MSG16);
BOOL32 ret;
*msg16 = *msg;
ret = WIN16_IsDialogMessage16( hwndDlg, SEGPTR_GET(msg16) );
SEGPTR_FREE(msg16);
return ret;
}
/***********************************************************************
* IsDialogMessage32A (USER32.342)
*/

View file

@ -800,6 +800,7 @@ INT32 WINPROC_MapMsg16To32A( UINT16 msg16, WPARAM16 wParam16, UINT32 *pmsg32,
}
return 1;
case WM_GETTEXT:
case WM_SETTEXT:
*plparam = (LPARAM)PTR_SEG_TO_LIN(*plparam);
return 0;
case WM_MDICREATE:
@ -883,9 +884,6 @@ INT32 WINPROC_MapMsg16To32A( UINT16 msg16, WPARAM16 wParam16, UINT32 *pmsg32,
*plparam = (LPARAM)(HWND32)LOWORD(*plparam);
}
return 0;
case WM_SETTEXT:
*plparam = (LPARAM)PTR_SEG_TO_LIN(*plparam);
return 0;
case WM_WINDOWPOSCHANGING:
case WM_WINDOWPOSCHANGED:
{
@ -898,6 +896,26 @@ INT32 WINPROC_MapMsg16To32A( UINT16 msg16, WPARAM16 wParam16, UINT32 *pmsg32,
*plparam = (LPARAM)wp;
}
return 1;
case WM_GETDLGCODE:
{
LPMSG16 msg16 = (LPMSG16)PTR_SEG_TO_LIN(*plparam);
LPMSG32 msg32 = (LPMSG32)HeapAlloc( SystemHeap, 0, sizeof(MSG32) );
if (!msg32) return -1;
msg32->hwnd = msg16->hwnd;
msg32->lParam = msg16->lParam;
msg32->time = msg16->time;
CONV_POINT16TO32(&msg16->pt,&msg32->pt);
/* this is right, right? */
if (WINPROC_MapMsg16To32A(msg16->message,msg16->wParam,
&msg32->message,&msg32->wParam,
&msg32->lParam)<0) {
HeapFree( SystemHeap, 0, msg32 );
return -1;
}
*plparam = (LPARAM)msg32;
}
return 1;
case WM_NOTIFY:
*plparam = (LPARAM)PTR_SEG_TO_LIN(*plparam);
return 1;
@ -1003,6 +1021,15 @@ LRESULT WINPROC_UnmapMsg16To32A( UINT32 msg, WPARAM32 wParam, LPARAM lParam,
HeapFree( SystemHeap, 0, wp );
}
break;
case WM_GETDLGCODE:
{
LPMSG32 msg32 = (LPMSG32)lParam;
WINPROC_UnmapMsg16To32A( msg32->message, msg32->wParam, msg32->lParam,
result);
HeapFree( SystemHeap, 0, msg32 );
}
break;
}
return result;
}
@ -1064,6 +1091,26 @@ INT32 WINPROC_MapMsg16To32W( UINT16 msg16, WPARAM16 wParam16, UINT32 *pmsg32,
*plparam = (LPARAM)cs;
}
return 1;
case WM_GETDLGCODE:
{
LPMSG16 msg16 = (LPMSG16)PTR_SEG_TO_LIN(*plparam);
LPMSG32 msg32 = (LPMSG32)HeapAlloc( SystemHeap, 0, sizeof(MSG32) );
if (!msg32) return -1;
msg32->hwnd = msg16->hwnd;
msg32->lParam = msg16->lParam;
msg32->time = msg16->time;
CONV_POINT16TO32(&msg16->pt,&msg32->pt);
/* this is right, right? */
if (WINPROC_MapMsg16To32W(msg16->message,msg16->wParam,
&msg32->message,&msg32->wParam,
&msg32->lParam)<0) {
HeapFree( SystemHeap, 0, msg32 );
return -1;
}
*plparam = (LPARAM)msg32;
}
return 1;
default: /* No Unicode translation needed */
return WINPROC_MapMsg16To32A( msg16, wParam16, pmsg32,
pwparam32, plparam );
@ -1112,6 +1159,15 @@ LRESULT WINPROC_UnmapMsg16To32W( UINT32 msg, WPARAM32 wParam, LPARAM lParam,
HeapFree( SystemHeap, 0, cs );
}
break;
case WM_GETDLGCODE:
{
LPMSG32 msg32 = (LPMSG32)lParam;
WINPROC_UnmapMsg16To32W( msg32->message, msg32->wParam, msg32->lParam,
result);
HeapFree( SystemHeap, 0, msg32 );
}
break;
default:
return WINPROC_UnmapMsg16To32A( msg, wParam, lParam, result );
}
@ -1526,7 +1582,8 @@ INT32 WINPROC_MapMsg32ATo16( HWND32 hwnd, UINT32 msg32, WPARAM32 wParam32,
case WM_PAINTCLIPBOARD:
case WM_SIZECLIPBOARD:
case WM_WININICHANGE:
WARN( msg, "message %04x needs translation\n", msg32 );
case WM_GETDLGCODE:
FIXME( msg, "message %04x needs translation\n", msg32 );
return -1;
default: /* No translation needed */