Created
July 2, 2018 13:06
-
-
Save Batname/59a8de5e486724d2333fc53b061b329a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Determine the resolution of the clients desktop screen. | |
screenWidth = GetSystemMetrics(SM_CXSCREEN); | |
screenHeight = GetSystemMetrics(SM_CYSCREEN); | |
// Setup the screen settings depending on whether it is running in full screen or in windowed mode. | |
if(FULL_SCREEN) | |
{ | |
// If full screen set the screen to maximum size of the users desktop and 32bit. | |
memset(&dmScreenSettings, 0, sizeof(dmScreenSettings)); | |
dmScreenSettings.dmSize = sizeof(dmScreenSettings); | |
dmScreenSettings.dmPelsWidth = (unsigned long)screenWidth; | |
dmScreenSettings.dmPelsHeight = (unsigned long)screenHeight; | |
dmScreenSettings.dmBitsPerPel = 32; | |
dmScreenSettings.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT; | |
// Change the display settings to full screen. | |
ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN); | |
// Set the position of the window to the top left corner. | |
posX = posY = 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment