Author: cwittich
Date: Sat Dec 8 21:11:28 2007
New Revision: 31087
URL:
http://svn.reactos.org/svn/reactos?rev=31087&view=rev
Log:
Dmitry Timoshkov : Windows doesn' t send the initialization messages to a dialog if a
passed in dlgProc is NULL . <dmitry at codeweavers.com>
Modified:
trunk/reactos/dll/win32/user32/windows/dialog.c
Modified: trunk/reactos/dll/win32/user32/windows/dialog.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/d…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/dialog.c (original)
+++ trunk/reactos/dll/win32/user32/windows/dialog.c Sat Dec 8 21:11:28 2007
@@ -798,7 +798,7 @@
if (unicode) SetWindowLongPtrW( hwnd, DWLP_DLGPROC, (ULONG_PTR)dlgProc );
else SetWindowLongPtrA( hwnd, DWLP_DLGPROC, (ULONG_PTR)dlgProc );
- if (dlgInfo->hUserFont)
+ if (dlgProc && dlgInfo->hUserFont)
SendMessageW( hwnd, WM_SETFONT, (WPARAM)dlgInfo->hUserFont, 0 );
/* Create controls */
@@ -806,16 +806,17 @@
if (DIALOG_CreateControls32( hwnd, dlgTemplate, &template, hInst, unicode ))
{
/* Send initialisation messages and set focus */
-
- if (SendMessageW( hwnd, WM_INITDIALOG, (WPARAM)dlgInfo->hwndFocus, param )
&&
- ((~template.style & DS_CONTROL) || (template.style & WS_VISIBLE)))
- {
- /* By returning TRUE, app has requested a default focus assignment */
- dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE);
- if( dlgInfo->hwndFocus )
- SetFocus( dlgInfo->hwndFocus );
- }
-
+ if (dlgProc)
+ {
+ if (SendMessageW( hwnd, WM_INITDIALOG, (WPARAM)dlgInfo->hwndFocus, param )
&&
+ ((~template.style & DS_CONTROL) || (template.style &
WS_VISIBLE)))
+ {
+ /* By returning TRUE, app has requested a default focus assignment */
+ dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE);
+ if( dlgInfo->hwndFocus )
+ SetFocus( dlgInfo->hwndFocus );
+ }
+ }
if (!(GetWindowLongW( hwnd, GWL_STYLE ) & WS_CHILD))
SendMessageW( hwnd, WM_CHANGEUISTATE, MAKEWPARAM(UIS_INITIALIZE, 0), 0);