Jump to content
  • Advertisement
Sign in to follow this  
Prozak

How to detect full screen app?

This topic is 4958 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!