From: James Tabor Date: Mon, 8 Mar 2010 20:57:24 +0000 (+0000) Subject: [User32] X-Git-Tag: backups/header-work@57446~208^2~8 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=f8fced000d87a633dc2fa18d85251833005402f4;hp=63f9072074e5798e05fc6bf773f4c294a5dfb911 [User32] - Andrew Nguyen : Ensure That WM_INITDIALOG passes the first tabstop control handle to the dialog procedure. - Henri Verbeet : Also show dialogs right after a WM_TIMER message. svn path=/trunk/; revision=46007 --- diff --git a/reactos/dll/win32/user32/windows/dialog.c b/reactos/dll/win32/user32/windows/dialog.c index 1f2720e54e9..eec7b45512f 100644 --- a/reactos/dll/win32/user32/windows/dialog.c +++ b/reactos/dll/win32/user32/windows/dialog.c @@ -560,6 +560,12 @@ INT DIALOG_DoDialogBox( HWND hwnd, HWND owner ) DispatchMessageW( &msg ); } if (dlgInfo->flags & DF_END) break; + + if (bFirstEmpty && msg.message == WM_TIMER) + { + ShowWindow( hwnd, SW_SHOWNORMAL ); + bFirstEmpty = FALSE; + } } } if (dlgInfo->flags & DF_OWNERENABLED) DIALOG_EnableOwner( owner ); @@ -968,10 +974,13 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate, if (dlgProc) { - if (SendMessageW( hwnd, WM_INITDIALOG, (WPARAM)dlgInfo->hwndFocus, param ) && + HWND focus = GetNextDlgTabItem( hwnd, 0, FALSE ); + if (SendMessageW( hwnd, WM_INITDIALOG, (WPARAM)focus, param ) && ((~template.style & DS_CONTROL) || (template.style & WS_VISIBLE))) { - /* By returning TRUE, app has requested a default focus assignment */ + /* By returning TRUE, app has requested a default focus assignment. + * WM_INITDIALOG may have changed the tab order, so find the first + * tabstop control again. */ dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE); if( dlgInfo->hwndFocus ) SetFocus( dlgInfo->hwndFocus );