[DllImport("kernel32.dll")] private static extern IntPtr GetStdHandle(int handle); [DllImport("kernel32.dll")] private static extern bool SetConsoleDisplayMode(IntPtr hConsole, int mode); IntPtr hConsole = GetStdHandle(-11); // get console handle SetConsoleDisplayMode(hConsole, 1); // make console fullscreen
Use SetConsoleDisplayMode(hConsole, 2); to go back to windowed console.