- Update KTHREAD and KUSER_SHARED_DATA to latest versions. This should make 2K3 drive...
[reactos.git] / reactos / subsys / win32k / ntuser / window.c
index 73f7e11..7afc46f 100644 (file)
@@ -571,7 +571,7 @@ co_DestroyThreadWindows(struct _ETHREAD *Thread)
    PLIST_ENTRY Current;
    PWINDOW_OBJECT Wnd;
    USER_REFERENCE_ENTRY Ref;
-   WThread = Thread->Tcb.Win32Thread;
+   WThread = (PW32THREAD)Thread->Tcb.Win32Thread;
    
    while (!IsListEmpty(&WThread->WindowListHead))
    {
@@ -1121,7 +1121,7 @@ NtUserBuildHwndList(
          SetLastWin32Error(ERROR_INVALID_PARAMETER);
          return 0;
       }
-      if(!(W32Thread = Thread->Tcb.Win32Thread))
+      if(!(W32Thread = (PW32THREAD)Thread->Tcb.Win32Thread))
       {
          ObDereferenceObject(Thread);
          DPRINT("Thread is not a GUI Thread!\n");
@@ -1622,7 +1622,7 @@ co_IntCreateWindowEx(DWORD dwExStyle,
       PRTL_USER_PROCESS_PARAMETERS ProcessParams;
       BOOL CalculatedDefPosSize = FALSE;
 
-      IntGetDesktopWorkArea(Window->OwnerThread->Tcb.Win32Thread->Desktop, &WorkArea);
+      IntGetDesktopWorkArea(((PW32THREAD)Window->OwnerThread->Tcb.Win32Thread)->Desktop, &WorkArea);
 
       rc = WorkArea;
       ProcessParams = PsGetCurrentProcess()->Peb->ProcessParameters;
@@ -2274,7 +2274,7 @@ IntFindWindow(PWINDOW_OBJECT Parent,
          /* Do not send WM_GETTEXT messages in the kernel mode version!
             The user mode version however calls GetWindowText() which will
             send WM_GETTEXT messages to windows belonging to its processes */
-         if((!CheckWindowName || !RtlCompareUnicodeString(WindowName, &(Child->WindowName), FALSE)) &&
+         if((!CheckWindowName || !RtlCompareUnicodeString(WindowName, &(Child->WindowName), TRUE)) &&
                (!ClassAtom || Child->Class->Atom == ClassAtom))
          {
             Ret = Child->hSelf;
@@ -2453,7 +2453,7 @@ NtUserFindWindowEx(HWND hwndParent,
                The user mode version however calls GetWindowText() which will
                send WM_GETTEXT messages to windows belonging to its processes */
             WindowMatches = !CheckWindowName || !RtlCompareUnicodeString(
-                               &WindowName, &TopLevelWindow->WindowName, FALSE);
+                               &WindowName, &TopLevelWindow->WindowName, TRUE);
             ClassMatches = !CheckClassName ||
                            ClassAtom == TopLevelWindow->Class->Atom;
 
@@ -3363,7 +3363,7 @@ co_UserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi)
             /*
              * Remove extended window style bit WS_EX_TOPMOST for shell windows.
              */
-            WindowStation = Window->OwnerThread->Tcb.Win32Thread->Desktop->WindowStation;
+            WindowStation = ((PW32THREAD)Window->OwnerThread->Tcb.Win32Thread)->Desktop->WindowStation;
             if(WindowStation)
             {
                if (hWnd == WindowStation->ShellWindow || hWnd == WindowStation->ShellListView)
@@ -3554,7 +3554,23 @@ NtUserGetWindowPlacement(HWND hWnd,
    }
 
    Safepl.flags = 0;
-   Safepl.showCmd = ((Window->Flags & WINDOWOBJECT_RESTOREMAX) ? SW_MAXIMIZE : SW_SHOWNORMAL);
+   if (0 == (Window->Style & WS_VISIBLE))
+   {
+      Safepl.showCmd = SW_HIDE;
+   }
+   else if (0 != (Window->Flags & WINDOWOBJECT_RESTOREMAX) ||
+            0 != (Window->Style & WS_MAXIMIZE))
+   {
+      Safepl.showCmd = SW_MAXIMIZE;
+   }
+   else if (0 != (Window->Style & WS_MINIMIZE))
+   {
+      Safepl.showCmd = SW_MINIMIZE;
+   }
+   else if (0 != (Window->Style & WS_MINIMIZE))
+   {
+      Safepl.showCmd = SW_SHOWNORMAL;
+   }
 
    Size.x = Window->WindowRect.left;
    Size.y = Window->WindowRect.top;