Commit in reactos/lib/user32/windows on MAIN
dialog.c+3-211.27 -> 1.28
Zach Gorman <zach@archetypeauction.com>
The initial dialog focus should be established by the default handler
for SetFocus(), not in the dialog creation code.

reactos/lib/user32/windows
dialog.c 1.27 -> 1.28
diff -u -r1.27 -r1.28
--- dialog.c	15 Aug 2004 21:36:29 -0000	1.27
+++ dialog.c	22 Nov 2004 10:59:01 -0000	1.28
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: dialog.c,v 1.27 2004/08/15 21:36:29 chorns Exp $
+/* $Id: dialog.c,v 1.28 2004/11/22 10:59:01 gvg Exp $
  *
  * PROJECT:         ReactOS user32.dll
  * FILE:            lib/user32/windows/dialog.c
@@ -816,33 +816,15 @@
     
     if (DIALOG_CreateControls32( hwnd, dlgTemplate, &template, hInst, unicode ))
     {
-        HWND hwndPreInitFocus;
-
         /* Send initialisation messages and set focus */
 
-       dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE );
-
-        hwndPreInitFocus = GetFocus();
-        if (SendMessageA( hwnd, WM_INITDIALOG, (WPARAM)dlgInfo->hwndFocus, param ))
+        if (SendMessageW( hwnd, WM_INITDIALOG, (WPARAM)dlgInfo->hwndFocus, param ))
         {
-            /* check where the focus is again,
-             * some controls status might have changed in WM_INITDIALOG */
+            /* By returning TRUE, app has requested a default focus assignment */
             dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE);
             if( dlgInfo->hwndFocus )
                 SetFocus( dlgInfo->hwndFocus );
         }
-        else
-        {
-            /* 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) &&
-                (GetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE))
-            {
-                dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE);
-                if( dlgInfo->hwndFocus )
-                    SetFocus( dlgInfo->hwndFocus );
-            }
-        }
 
         if (template.style & WS_VISIBLE && !(GetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE))
         {
CVSspam 0.2.8