A very short question: How can I detect that there is a full screen application running? I tried the following code:
code:
// Check if full screen app is running
bool IsFullScreenAppRunning () {
HWND hWnd = GetForegroundWindow();
if(!hWnd)
return false;
RECT rc;
if(!GetWindowRect(hWnd,&rc))
return false;
return (rc.right - rc.left >= GetSystemMetrics(SM_CXSCREEN) && rc.bottom - rc.top >= GetSystemMetrics(SM_CYSCREEN));
}
But that has got 2 problems:
1. It returns true if my desktop is the foreground window (i.e. there aren't really any windows)
2. There can be another window on top of the fullscreen window, and then this function returns false, which is not what I want.
Does anybody know how to fix this? Using GetClientRect doesn't work either