[WIN32SS][USER32] Fix SwitchToThisWindow (#929)
authorKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Wed, 24 Oct 2018 11:02:27 +0000 (20:02 +0900)
committerGitHub <noreply@github.com>
Wed, 24 Oct 2018 11:02:27 +0000 (20:02 +0900)
I'm not sure but it seems like no one can investigate it. I commit it.

win32ss/user/user32/windows/window.c

index 227ab9c..048673f 100644 (file)
@@ -85,13 +85,13 @@ SwitchToThisWindow(HWND hwnd, BOOL fAltTab)
     if (fAltTab)
     {
         if (IsIconic(hwnd))
-            ShowWindowAsync(hwnd, SW_RESTORE);
+            PostMessageW(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
         SetForegroundWindow(hwnd);
     }
     else
     {
         hwndFG = GetForegroundWindow();
-        ShowWindow(hwnd, SW_RESTORE | SW_SHOWNA);
+        PostMessageW(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
         SetWindowPos(hwnd, hwndFG, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
         SetWindowPos(hwndFG, hwnd, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
     }