diff options
Diffstat (limited to 'yapp/message_pump.cpp')
-rw-r--r-- | yapp/message_pump.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/yapp/message_pump.cpp b/yapp/message_pump.cpp index 3d67948..aedac1e 100644 --- a/yapp/message_pump.cpp +++ b/yapp/message_pump.cpp @@ -18,8 +18,16 @@ HANDLE hMPEvent; bool is_full_screen() {
int w = GetSystemMetrics(SM_CXSCREEN);
int h = GetSystemMetrics(SM_CYSCREEN);
-
+ RECT WindowRect;
HWND hWnd = 0;
+
+ // check foregroundwindow
+ hWnd = GetForegroundWindow();
+ GetWindowRect(hWnd, &WindowRect);
+ if ((WindowRect.right - WindowRect.left) >= w && (WindowRect.bottom - WindowRect.top) >= h)
+ return true;
+
+ // check other top level windows
while (hWnd = FindWindowEx(NULL, hWnd, NULL, NULL)) {
if(!IsWindowVisible(hWnd) || IsIconic(hWnd))
continue;
@@ -28,13 +36,13 @@ bool is_full_screen() { continue;
// not sure if this could be done more simply using 'IsZoomed'?
- RECT WindowRect;
GetWindowRect(hWnd, &WindowRect);
- if ((w != (WindowRect.right - WindowRect.left)) || (h != (WindowRect.bottom - WindowRect.top)))
+ if ((WindowRect.right - WindowRect.left) < w || (WindowRect.bottom - WindowRect.top) < h)
continue;
return true;
}
+
return false;
}
|