From 2b37da679213b45835fa77bac5a1e77aac40e451 Mon Sep 17 00:00:00 2001 From: Gerard Patel Date: Sun, 23 Apr 2000 19:57:50 +0000 Subject: [PATCH] Check if dialog is visible before setting the focus. --- windows/dialog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/windows/dialog.c b/windows/dialog.c index 568a574e874..ccd3e167370 100644 --- a/windows/dialog.c +++ b/windows/dialog.c @@ -788,8 +788,8 @@ HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCSTR dlgTemplate, { /* If the dlgproc has returned FALSE (indicating handling of keyboard focus) but the focus has not changed, set the focus where we expect it. */ - if ( GetFocus() == hwndPreInitFocus ) - SetFocus( dlgInfo->hwndFocus ); + if ( (wndPtr->dwStyle & WS_VISIBLE) && ( GetFocus() == hwndPreInitFocus ) ) + SetFocus( dlgInfo->hwndFocus ); } if (template.style & WS_VISIBLE && !(wndPtr->dwStyle & WS_VISIBLE))