"Santosh Siddheshwar" santosh.s@sonata-software.com wrote:
I didnt get the second point that you mention Another one might be that WM_CREATE must be always passed to DEFDLG_Proc regardless of what result an application returned to DefDlgProc16/A/W.
Here is a snippet of DefDlgProc16 (DefDlgProcA/W are the same):
LRESULT WINAPI DefDlgProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam, LPARAM lParam ) { WNDPROC16 dlgproc; HWND hwnd32 = WIN_Handle32( hwnd ); BOOL result = FALSE;
===== Perhaps WM_CREATE handling code should be moved here: if (msg == WM_CREATE) { wndPtr->flags |= WIN_ISDIALOG; blah-blah-blah } =====
SetWindowLongW( hwnd32, DWL_MSGRESULT, 0 );
if ((dlgproc = (WNDPROC16)DEFDLG_GetDlgProc( hwnd32 ))) { /* Call dialog procedure */ result = CallWindowProc16( dlgproc, hwnd, msg, wParam, lParam ); /* 16 bit dlg procs only return BOOL16 */ if( WINPROC_GetProcType( (WNDPROC)dlgproc ) == WIN_PROC_16 ) result = LOWORD(result); }
if (!result && IsWindow(hwnd32)) <== here we check whether an app handled the message { /* callback didn't process this message */
switch(msg) { case WM_ERASEBKGND:
Probably WM_CREATE handling should be performed even before control is passed to an application.