user32: Check the active window instead of the foreground to show/hide owned popups.
diff --git a/dlls/user32/nonclient.c b/dlls/user32/nonclient.c
index c8d19d9..a685370 100644
--- a/dlls/user32/nonclient.c
+++ b/dlls/user32/nonclient.c
@@ -1548,19 +1548,19 @@
         break;
 
     case SC_MINIMIZE:
-        if (hwnd == GetForegroundWindow())
+        if (hwnd == GetActiveWindow())
             ShowOwnedPopups(hwnd,FALSE);
         ShowWindow( hwnd, SW_MINIMIZE );
         break;
 
     case SC_MAXIMIZE:
-        if (IsIconic(hwnd) && hwnd == GetForegroundWindow())
+        if (IsIconic(hwnd) && hwnd == GetActiveWindow())
             ShowOwnedPopups(hwnd,TRUE);
         ShowWindow( hwnd, SW_MAXIMIZE );
         break;
 
     case SC_RESTORE:
-        if (IsIconic(hwnd) && hwnd == GetForegroundWindow())
+        if (IsIconic(hwnd) && hwnd == GetActiveWindow())
             ShowOwnedPopups(hwnd,TRUE);
         ShowWindow( hwnd, SW_RESTORE );
         break;