diff options
author | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-01-08 11:29:31 +0000 |
---|---|---|
committer | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-01-08 11:29:31 +0000 |
commit | 11ca24e66168aa95ed6b82c76f49373f71a6d701 (patch) | |
tree | 25980998b73a88689f11999111f5f3d669bad249 | |
parent | cfe58e9ff85db5b2d4cd77812cd3631395177b4c (diff) |
merge both is_full_screen functions (idea from Alexander Rivilis)
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@72 4f64403b-2f21-0410-a795-97e2b3489a10
-rw-r--r-- | yapp/message_pump.cpp | 14 | ||||
-rw-r--r-- | yapp/version.h | 2 |
2 files changed, 12 insertions, 4 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;
}
diff --git a/yapp/version.h b/yapp/version.h index 39bbc6e..c3569a6 100644 --- a/yapp/version.h +++ b/yapp/version.h @@ -4,7 +4,7 @@ #define __MAJOR_VERSION 0
#define __MINOR_VERSION 2
#define __RELEASE_NUM 0
-#define __BUILD_NUM 1
+#define __BUILD_NUM 2
#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
#define __FILEVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM
|