Created
May 7, 2013 14:27
-
-
Save begedin/5532954 to your computer and use it in GitHub Desktop.
Function to set console window visibility.
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
public static void setConsoleWindowVisibility(bool visible, string title) | |
{ | |
IntPtr hWnd = FindWindow(null, title); | |
if (hWnd != IntPtr.Zero) | |
{ | |
if (!visible) | |
//Hide the window | |
ShowWindow(hWnd, 0); // 0 = SW_HIDE | |
else | |
//Show window again | |
ShowWindow(hWnd, 1); //1 = SW_SHOWNORMA | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment