Check if window is full screen in c++?

Started by
0 comments, last by FXACE 12 years, 3 months ago
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?
Advertisement
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.



EDIT0:


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.

This topic is closed to new replies.

Advertisement