Jump to content
Site Stability Read more... ×
  • Advertisement
Sign in to follow this  

Check if window is full screen in c++?

This topic is 2855 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'm trying to make a command that can check if my window is full screen. I use ChangeDisplaySettings with CDS_FULLSCREEN to change the window to full screen, and I could set a bool to tell when the window is full screen but it would make my code a bit cleaner if I could simply read the display settings. Is this possible?

Share this post

Link to post
Share on other sites
RECT windowRect;

GetClientRect(HWND, &windowRect);

windowRect.left == 0 && windowRect.top == 0 && windowRect.right == GetSystemMetrics(SM_CXSCREEN) && windowRect.bottom == GetSystemMetrics(SM_CYSCREEN) <--- if true, your window in 'fullscreen' mode...

P.S. Do not change REFRESH_RATE of the screen in ChangeDisplaySettings (If you using that option). Better to keep it by default.


Or you can determine by style of your window :

(GetWindowLong(HWND,GWL_STYLE) & WS_POPUP != 0) <-- if true, your window in 'fullscreen' mode...

if you are using 'frame' style of your window in 'windowed' mode.

end of EDIT0.

Best wishes, FXACE.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!