[USER32] Fix Task Switcher (#976)
[reactos.git] / win32ss / user / user32 / controls / appswitch.c
index cd13841..c2898b9 100644 (file)
 //
 //
 
-
 #include <user32.h>
 
-#include <wine/debug.h>
 WINE_DEFAULT_DEBUG_CHANNEL(user32);
 
 #define DIALOG_MARGIN   8       // margin of dialog contents
@@ -127,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);
@@ -173,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) )