This topic is now archived and is closed to further replies.

Gnome Programmer

Fullscreen using Win32?

Recommended Posts


just create your windows with WS_POPUP style and use this code to switch to fullscreen:

bool EnterFullscreen ()
DEVMODE newSettings;
// now fill the DEVMODE with standard settings, mainly monitor frequenzy

EnumDisplaySettings ( NULL, 0, &newSettings );
// set desired screen size/res

newSettings.dmPelsWidth = 800;
newSettings.dmPelsHeight = 600;
newSettings.dmBitsPerPel = 16;
//set those flags to let the next function know what we want to change

// and apply the new settings

if ( ChangeDisplaySettings ( &newSettings, CDS_FULLSCREEN )
return false; // in case of error

else return true;

// and to reset the screen on program exit:

void ResetScreen ()
// this resets the screen to the registry-stored values

ChangeDisplaySettings ( NULL, 0 );

just substitute the 800/600/16 with the screen res you want

Runicsoft -- home of my open source Function Parser and more

Share this post

Link to post
Share on other sites