Best Method for Minimizable Fullscreen Window
Posted
by kaykun
on Stack Overflow
See other posts from Stack Overflow
or by kaykun
Published on 2010-03-28T17:06:29Z
Indexed on
2010/03/28
17:13 UTC
Read the original article
Hit count: 493
Hi, I'm coding a short game in C++ and Win32, and I want to be able to make it in fullscreen with a fixed size. I also want the user to be able to switch focus between the game window and other windows as much as he/she wants without any weird screen glitches.
So far I know of the ChangeDisplaySettings
function and creating the window with the WS_POPUP
style at initialization to make it fullscreen. To detect the user switching focus to other windows by way of alt+tab or otherwise, what messages should I be handling on the window's WndProc
or should I be using another function? When loss of focus is detected should I only call ChangeDisplaySettings(NULL, 0);
or are there other functions I should call as well? And what method should I use to handle focus back into the window?
Also can anyone give me some info on how to make it work smoothly for different screen sizes?
Thanks for any help.
© Stack Overflow or respective owner