Sign in to follow this  
Prozak

How to detect full screen app?

Recommended Posts

I would like to automaticly disable some stuff i've got running on the background, whenever I run a game, so I would like to know how to detect if there is a full screen app running... Is there an apropriate set of API calls for this?

Share this post


Link to post
Share on other sites
Quote:
When the display mode is changed dynamically, the WM_DISPLAYCHANGE message is sent to all running applications with the following message parameters.

wParam New bits per pixel
LOWORD(lParam) New pixel width
HIWORD(lParam) New pixel height





http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/devcons_7e2b.asp

Share this post


Link to post
Share on other sites
Quote:
Original post by antareus
What if the resolution doesn't change?


That came from the ChangeDisplaySettings fucntion docs. If you are in x*y and you switch to x*y fullscreen, it should still get sent the message? You still call the function either way.

Share this post


Link to post
Share on other sites
use WindowFromPoint like this:

HWND IsThereAFullscreenAppRunning()
{
HWND hWnd;
POINT pt;
pt.x = 0;
pt.y = 0;
hWnd = WindowFromPoint( pt );
pt.x = screen_width-1;
pt.y = screen_height-1;
if( hWnd == WindowFromPoint( pt ) )
return hWnd;
return NULL;
}

where screen_width and screen_height is your screen resolution.

Hope I helped

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this