Last active
August 29, 2015 14:02
-
-
Save omni-/abe51695d34149881eb2 to your computer and use it in GitHub Desktop.
Fullscreen console
This file contains hidden or 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
using System; | |
using System.Runtime.InteropServices; | |
namespace fullscreen | |
{ | |
[DllImport("kernel32.dll", ExactSpelling = true)] | |
public static extern IntPtr GetConsoleWindow(); | |
public static IntPtr ThisConsole = GetConsoleWindow(); | |
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] | |
public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); public const int HIDE = 0; public const int MAXIMIZE = 3; | |
public const int MINIMIZE = 6; public const int RESTORE = 9; | |
public static void Main(string[] args) | |
{ | |
Console.SetWindowSize(Console.LargestWindowWidth - 4, Console.LargestWindowHeight); | |
ShowWindow(ThisConsole, MAXIMIZE); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment