From e81e7feec300383661beaebf757366d02f094062 Mon Sep 17 00:00:00 2001 From: sje Date: Tue, 5 Jun 2007 06:05:07 +0000 Subject: another fix for full-screen detection (do not accept GetShellWindow (program manager) as full-screen app) git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@200 4f64403b-2f21-0410-a795-97e2b3489a10 --- yapp/message_pump.cpp | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'yapp/message_pump.cpp') diff --git a/yapp/message_pump.cpp b/yapp/message_pump.cpp index 277e715..19d36e6 100644 --- a/yapp/message_pump.cpp +++ b/yapp/message_pump.cpp @@ -24,25 +24,44 @@ bool is_full_screen() { // check foregroundwindow hWnd = GetForegroundWindow(); - if(hWnd && hWnd != GetDesktopWindow()) { + if(hWnd && hWnd != GetDesktopWindow() && hWnd != GetShellWindow()) { GetClientRect(hWnd, &ClientRect); - if ((ClientRect.right - ClientRect.left) >= w && (ClientRect.bottom - ClientRect.top) >= h) + if ((ClientRect.right - ClientRect.left) >= w && (ClientRect.bottom - ClientRect.top) >= h) { + /* + { + TCHAR buf[512]; + if(GetWindowText(hWnd, buf, 512)) + PUShowMessageW(buf, SM_NOTIFY); + else + PUShowMessage("no title", SM_NOTIFY); + } + */ return true; + } } // check other top level windows while (hWnd = FindWindowEx(NULL, hWnd, NULL, NULL)) { - if(!IsWindowVisible(hWnd) || IsIconic(hWnd) || GetDesktopWindow() == hWnd) + if(IsWindowVisible(hWnd) == 0 || IsIconic(hWnd) || hWnd == GetDesktopWindow() || hWnd == GetShellWindow()) 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'? GetClientRect(hWnd, &ClientRect); if ((ClientRect.right - ClientRect.left) < w || (ClientRect.bottom - ClientRect.top) < h) continue; + /* + { + TCHAR buf[512]; + if(GetWindowText(hWnd, buf, 512)) + PUShowMessageW(buf, SM_NOTIFY); + else + PUShowMessage("no title", SM_NOTIFY); + } + */ return true; } -- cgit v1.2.3