Fix DIALOG_CreateIndirect killing focus

Dave Hawkes daveh-wine at cadlink.com
Wed Dec 5 13:18:46 CST 2001


DIALOG_CreateIndirect can incorrectly kill the current input focus.

Dave Hawkes

-------------- next part --------------
Index: windows/dialog.c
===================================================================
RCS file: /home/wine/wine/windows/dialog.c,v
retrieving revision 1.95
diff -u -r1.95 dialog.c
--- windows/dialog.c	2001/11/06 20:57:27	1.95
+++ windows/dialog.c	2001/12/05 17:37:23
@@ -885,8 +885,9 @@
         {
             /* check where the focus is again,
 	     * some controls status might have changed in WM_INITDIALOG */
-            dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE); 
-            SetFocus( dlgInfo->hwndFocus );
+            dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE);
+            if( dlgInfo->hwndFocus )
+                SetFocus( dlgInfo->hwndFocus );
         }
         else
         {
@@ -896,7 +897,8 @@
                 (GetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE))
             {
                 dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE); 
-                SetFocus( dlgInfo->hwndFocus );
+                if( dlgInfo->hwndFocus )
+                    SetFocus( dlgInfo->hwndFocus );
             }
         }
 


More information about the wine-patches mailing list