[WIN32SS][USER32] Fix SwitchToThisWindow (#929)

I'm not sure but it seems like no one can investigate it. I commit it.
This commit is contained in:
Katayama Hirofumi MZ 2018-10-24 20:02:27 +09:00 committed by GitHub
parent 2410bcb133
commit 62da624689
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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);
}