From 4ccad609e0f07285dcf36c9a7bdad5b7c8dd8bad Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Thu, 25 Oct 2018 22:59:44 +0900 Subject: [PATCH] [USER32] Fix Task Switcher (#976) This fix is needed for the Delphi GUI programs. - Don't enumerate the windows whose owner window exists. - Use PostMessage SC_RESTORE instead of ShowWindowAsync SW_RESTORE. CORE-15165 --- win32ss/user/user32/controls/appswitch.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/win32ss/user/user32/controls/appswitch.c b/win32ss/user/user32/controls/appswitch.c index c776008ad0a..c2898b9e13a 100644 --- a/win32ss/user/user32/controls/appswitch.c +++ b/win32ss/user/user32/controls/appswitch.c @@ -125,7 +125,7 @@ void ResizeAndCenter(HWND hwnd, int width, int height) void MakeWindowActive(HWND hwnd) { if (IsIconic(hwnd)) - ShowWindowAsync(hwnd, SW_RESTORE); + PostMessageW(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0); BringWindowToTop(hwnd); // same as: SetWindowPos(hwnd,HWND_TOP,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE); ? SetForegroundWindow(hwnd); @@ -171,6 +171,9 @@ BOOL CALLBACK EnumerateCallback(HWND window, LPARAM lParam) if (!IsWindowVisible(window)) return TRUE; + if (GetWindow(window, GW_OWNER) != NULL) + return TRUE; + GetClassNameW(window, windowText, _countof(windowText)); if ((wcscmp(L"Shell_TrayWnd", windowText)==0) || (wcscmp(L"Progman", windowText)==0) ) -- 2.17.1