From 00a62b266bc12a5f340bb827e87a2bc41577707b Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> Date: Tue, 17 Aug 2010 00:24:44 +0000 Subject: Fixed full screen detection after theme change git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@527 4f64403b-2f21-0410-a795-97e2b3489a10 --- yapp/message_pump.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'yapp') 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); -- cgit v1.2.3