summaryrefslogtreecommitdiff
path: root/yapp/message_pump.cpp
diff options
context:
space:
mode:
author(no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10>2010-08-17 00:24:44 +0000
committer(no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10>2010-08-17 00:24:44 +0000
commit00a62b266bc12a5f340bb827e87a2bc41577707b (patch)
treeb71d4e99c51c9e2f6b364b9a71ac479c10c06317 /yapp/message_pump.cpp
parentf022fc1b79ee29c7f8f796499129476fa49e0ca5 (diff)
Fixed full screen detection after theme change
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@527 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'yapp/message_pump.cpp')
-rw-r--r--yapp/message_pump.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/yapp/message_pump.cpp b/yapp/message_pump.cpp
index c2483d3..f3c8faf 100644
--- a/yapp/message_pump.cpp
+++ b/yapp/message_pump.cpp
@@ -20,11 +20,14 @@ bool is_full_screen() {
int h = GetSystemMetrics(SM_CYSCREEN);
// use ClientRect instead of WindowRect so that it works normally for maximized applications - thx Nikto
RECT ClientRect;
- HWND hWnd = 0;
+ HWND hWnd;
+
+ HWND hWndDesktop = GetDesktopWindow();
+ HWND hWndShell = GetShellWindow();
// check foregroundwindow
hWnd = GetForegroundWindow();
- if(hWnd && hWnd != GetDesktopWindow() && hWnd != GetShellWindow()) {
+ if(hWnd && hWnd != hWndDesktop && hWnd != hWndShell) {
GetClientRect(hWnd, &ClientRect);
if ((ClientRect.right - ClientRect.left) >= w && (ClientRect.bottom - ClientRect.top) >= h)
return true;
@@ -32,13 +35,13 @@ bool is_full_screen() {
// check other top level windows
while (hWnd = FindWindowEx(NULL, hWnd, NULL, NULL)) {
- if(IsWindowVisible(hWnd) == 0 || IsIconic(hWnd) || hWnd == GetDesktopWindow() || hWnd == GetShellWindow())
+ if(IsWindowVisible(hWnd) == 0 || IsIconic(hWnd) || hWnd == hWndDesktop || hWnd == hWndShell)
continue;
- if(DBGetContactSettingByte(0, MODULE, "ShowForNonTopmostFullscreenWindows", 0) == 1) {
+// if(DBGetContactSettingByte(0, MODULE, "ShowForNonTopmostFullscreenWindows", 0) == 1) {
if (!(GetWindowLong(hWnd, GWL_EXSTYLE) & WS_EX_TOPMOST))
continue;
- }
+// }
// not sure if this could be done more simply using 'IsZoomed'?
GetClientRect(hWnd, &ClientRect);