Fix the order of window style setting.
Modified: trunk/reactos/subsys/win32k/ntuser/window.c

Modified: trunk/reactos/subsys/win32k/ntuser/window.c
--- trunk/reactos/subsys/win32k/ntuser/window.c	2005-09-20 08:00:00 UTC (rev 17941)
+++ trunk/reactos/subsys/win32k/ntuser/window.c	2005-09-20 09:28:18 UTC (rev 17942)
@@ -1468,10 +1468,6 @@
 
    InsertTailList(&Class->ClassWindowsListHead, &Window->ClassListEntry);
 
-   Window->ExStyle = dwExStyle;
-   Window->Style = dwStyle & ~WS_VISIBLE;
-   DPRINT("1: Style is now %lx\n", Window->Style);
-
    Window->SystemMenu = (HMENU)0;
    Window->ContextHelpId = 0;
    Window->IDMenu = 0;
@@ -1571,19 +1567,19 @@
    /* Correct the window style. */
    if (!(dwStyle & WS_CHILD))
    {
-      Window->Style |= WS_CLIPSIBLINGS;
-      DPRINT("3: Style is now %lx\n", Window->Style);
+      dwStyle |= WS_CLIPSIBLINGS;
+      DPRINT("3: Style is now %lx\n", dwStyle);
       if (!(dwStyle & WS_POPUP))
       {
-         Window->Style |= WS_CAPTION;
+         dwStyle |= WS_CAPTION;
          Window->Flags |= WINDOWOBJECT_NEED_SIZE;
-         DPRINT("4: Style is now %lx\n", Window->Style);
+         DPRINT("4: Style is now %lx\n", dwStyle);
       }
    }
 
    /* create system menu */
-   if((Window->Style & WS_SYSMENU) &&
-         (Window->Style & WS_CAPTION) == WS_CAPTION)
+   if((dwStyle & WS_SYSMENU) &&
+         (dwStyle & WS_CAPTION) == WS_CAPTION)
    {
       SystemMenu = IntGetSystemMenu(Window, TRUE, TRUE);
       if(SystemMenu)
@@ -1608,6 +1604,9 @@
    Size.cx = nWidth;
    Size.cy = nHeight;
 
+   Window->ExStyle = dwExStyle;
+   Window->Style = dwStyle & ~WS_VISIBLE;
+
    /* call hook */
    Cs.lpCreateParams = lpParam;
    Cs.hInstance = hInstance;
@@ -1617,7 +1616,7 @@
    Cs.cy = Size.cy;
    Cs.x = Pos.x;
    Cs.y = Pos.y;
-   Cs.style = dwStyle;
+   Cs.style = Window->Style;
    Cs.lpszName = (LPCWSTR) WindowName;
    Cs.lpszClass = (LPCWSTR) ClassName;
    Cs.dwExStyle = dwExStyle;
@@ -2569,13 +2568,11 @@
 
       case GA_ROOT:
          {
-            PWINDOW_OBJECT tmp;
             WndAncestor = Wnd;
             Parent = NULL;
 
             for(;;)
             {
-               tmp = Parent;
                if(!(Parent = WndAncestor->Parent))
                {
                   break;