Click to See Complete Forum and Search --> : Check for Windows Desktop?
HELLFISH
June 11th, 2005, 04:13 PM
How do I check to see if the Windows Desktop is currently showing? My application is forced focus at a specific interval, but as a consequence, if the user is playing a fullscreen game, the game is minimized to bring up my application. I do not wish this to happen. If the game is utilizing fullscreen modes, then my application should not force focus.
Improving
June 11th, 2005, 07:36 PM
if(IsWindowVisible(GetDesktopWindow()))
{ // desktop visible}
golanshahar
June 12th, 2005, 02:38 AM
you might consider also using ::OpenDesktop(..) api
Cheers
SuperKoko
June 12th, 2005, 03:14 AM
Even, if fullscreen games are running the desktop remains visible (not for the user, but for Windows it is visible).
To see, if there is an application running in fullscreen mode, i suggest that you get all windows with EnumWindows, and get the dimensions of each window, with GetWindowRect.
Finally you must compare each window rectangle with the screen dimensions that you can get with GetSystemMetrics with SM_CXFULLSCREEN and SM_CYFULLSCREEN.
And if a window size exactly match the screen size, and this window is visible, and is not minimized, it means that there is a fullscreen application running.
I am not specialist of multiple monitors, so this thing can have problems with multiple monitors having the same size.
HELLFISH
June 15th, 2005, 12:40 AM
Thank you SuperKoko. You've given some very valuable input.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.