Last active
December 10, 2019 17:44
-
-
Save L4ZZA/2c8aa496fd7495c16def5cef060f6c2b to your computer and use it in GitHub Desktop.
Hide/Show console based on configuration for debug purposes.
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
//==========================================// | |
// Author: Pietro Lazzarotto // | |
// Credits 2019 // | |
//==========================================// | |
int main(int argc, char** argv) | |
{ | |
#ifdef _DEBUG | |
// get the console handle | |
auto hwnd = GetConsoleWindow(); | |
// change siize and position of the console to be at the bottom 1/4th of the screen (roughtly). | |
SetWindowPos(hwnd, HWND_TOP, 0, 1080 * 0.72, 1920, 1080 * 0.25, SWP_NOZORDER); | |
// Show console | |
ShowWindow(hwnd, SW_SHOW); | |
#else | |
// hide console | |
ShowWindow(GetConsoleWindow(), SW_HIDE); | |
#endif | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment