diff options
author | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-05-21 12:32:08 +0000 |
---|---|---|
committer | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-05-21 12:32:08 +0000 |
commit | 6848bc1605ad428ef21a8495a1117801fec01265 (patch) | |
tree | 6ef198b06c83e68099a8ac4e0dc2ae3835b67494 /yapp/message_pump.cpp | |
parent | 7a2e5720ff22302dc2aaf923c2638f6569ed865f (diff) |
fix for full screen detection (thx Nikto)
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@174 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'yapp/message_pump.cpp')
-rw-r--r-- | yapp/message_pump.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/yapp/message_pump.cpp b/yapp/message_pump.cpp index 767ac2c..93d783a 100644 --- a/yapp/message_pump.cpp +++ b/yapp/message_pump.cpp @@ -18,13 +18,14 @@ HANDLE hMPEvent; bool is_full_screen() {
int w = GetSystemMetrics(SM_CXSCREEN);
int h = GetSystemMetrics(SM_CYSCREEN);
- RECT WindowRect;
+ // use ClientRect instead of WindowRect so that it works normally for maximized applications - thx Nickto
+ RECT ClientRect;
HWND hWnd = 0;
// check foregroundwindow
hWnd = GetForegroundWindow();
- GetWindowRect(hWnd, &WindowRect);
- if ((WindowRect.right - WindowRect.left) >= w && (WindowRect.bottom - WindowRect.top) >= h)
+ GetClientRect(hWnd, &ClientRect);
+ if ((ClientRect.right - ClientRect.left) >= w && (ClientRect.bottom - ClientRect.top) >= h)
return true;
// check other top level windows
@@ -32,12 +33,12 @@ bool is_full_screen() { if(!IsWindowVisible(hWnd) || IsIconic(hWnd) || GetDesktopWindow() == hWnd)
continue;
- if (!(GetWindowLong(hWnd, GWL_EXSTYLE) & WS_EX_TOPMOST))
- continue;
+ //if (!(GetWindowLong(hWnd, GWL_EXSTYLE) & WS_EX_TOPMOST))
+ //continue;
// not sure if this could be done more simply using 'IsZoomed'?
- GetWindowRect(hWnd, &WindowRect);
- if ((WindowRect.right - WindowRect.left) < w || (WindowRect.bottom - WindowRect.top) < h)
+ GetClientRect(hWnd, &ClientRect);
+ if ((ClientRect.right - ClientRect.left) < w || (ClientRect.bottom - ClientRect.top) < h)
continue;
return true;
|