Check if dialog is visible before setting the focus.

This commit is contained in:
Gerard Patel 2000-04-23 19:57:50 +00:00 committed by Alexandre Julliard
parent 268a36e872
commit 2b37da6792
1 changed files with 2 additions and 2 deletions

View File

@ -788,7 +788,7 @@ HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCSTR dlgTemplate,
{ {
/* If the dlgproc has returned FALSE (indicating handling of keyboard focus) /* If the dlgproc has returned FALSE (indicating handling of keyboard focus)
but the focus has not changed, set the focus where we expect it. */ but the focus has not changed, set the focus where we expect it. */
if ( GetFocus() == hwndPreInitFocus ) if ( (wndPtr->dwStyle & WS_VISIBLE) && ( GetFocus() == hwndPreInitFocus ) )
SetFocus( dlgInfo->hwndFocus ); SetFocus( dlgInfo->hwndFocus );
} }