[WIN32SS][NTUSER] Don't freeze Task Bar in switching the app (#1243)
[reactos.git] / win32ss / user / ntuser / simplecall.c
index 0d2042b..7cd2c84 100644 (file)
@@ -342,7 +342,7 @@ NtUserCallOneParam(
         case ONEPARAM_ROUTINE_SETPROCDEFLAYOUT:
         {
             PPROCESSINFO ppi;
-            if (Param & LAYOUT_ORIENTATIONMASK)
+            if (Param & LAYOUT_ORIENTATIONMASK || Param == LAYOUT_LTR)
             {
                 ppi = PsGetCurrentProcessWin32Process();
                 ppi->dwLayout = Param;
@@ -392,7 +392,7 @@ NtUserCallOneParam(
            break;
 
         case ONEPARAM_ROUTINE_CREATESYSTEMTHREADS:
-            Result = CreateSystemThreads(Param);
+            Result = UserSystemThreadProc(Param);
             break;
 
         case ONEPARAM_ROUTINE_LOCKFOREGNDWINDOW:
@@ -508,20 +508,33 @@ NtUserCallTwoParam(
         case TWOPARAM_ROUTINE_SWITCHTOTHISWINDOW:
         {
             HWND hwnd = (HWND)Param1;
+            BOOL fAltTab = (BOOL)Param2;
             Ret = 0;
             Window = UserGetWindowObject(hwnd);
             if (!Window)
             {
                 break;
             }
-            if ((BOOL)Param2)
+            if (MsqIsHung(Window->head.pti))
+            {
+                // TODO: Make the window ghosted and activate.
+                break;
+            }
+            if (fAltTab)
             {
                 if (Window->style & WS_MINIMIZE)
                 {
                     UserPostMessage(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
                 }
+                /* bring window to top and activate */
+                co_WinPosSetWindowPos(Window, HWND_TOP, 0, 0, 0, 0,
+                                      SWP_NOSIZE | SWP_NOMOVE | SWP_NOSENDCHANGING |
+                                      SWP_NOOWNERZORDER | SWP_ASYNCWINDOWPOS);
+            }
+            else
+            {
+                UserSetActiveWindow(Window);
             }
-            UserSetActiveWindow(Window);
             break;
         }