Hi, 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. Regards Santosh Siddheshwar
-----Original Message----- From: Dmitry Timoshkov [SMTP:dmitry@baikal.ru] Sent: Tuesday, April 13, 2004 5:46 PM To: Robert Shearman; wine-devel@winehq.org Cc: santosh.s@sonata-software.com Subject: Re: Handling dialog messages for non-template based dialogs
"Robert Shearman" R.J.Shearman@warwick.ac.uk wrote:
if (!(dlgInfo = HeapAlloc( GetProcessHeap(), 0,
sizeof(*dlgInfo) ))) return 0;
Minor point, but you probably want to return -1 here to say that window creation failed.
Good catch. 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.
-- Dmitry.
********************************************************************* Disclaimer: The information in this e-mail and any attachments is confidential / privileged. It is intended solely for the addressee or addressees. If you are not the addressee indicated in this message, you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. *********************************************************************
"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.