How can I make a console app full screen in C#?,
Members - Reputation: 366
Posted 06 October 2010 - 03:18 PM
I got this code/discussion from here in case you wanted to read what the others had to say.
Here's some code:
[DllImport("kernel32.dll", ExactSpelling = true)]
private static extern IntPtr GetConsoleWindow();
private static IntPtr ThisConsole = GetConsoleWindow();
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
private const int HIDE = 0;
private const int MAXIMIZE = 3;
private const int MINIMIZE = 6;
private const int RESTORE = 9;
static void Main(string args)
Console.WriteLine("Hello World in Full Screen!");
Edit: Forgot to say this is not true full screen and the display height and width would determine the size of the screen so it might not be an acceptable solution....
Crossbones+ - Reputation: 16551
Posted 06 October 2010 - 08:45 PM
You might want to take note that this is a depreciated feature before coding in support for it at all.
Instead you could emulate full screen in XNA with a SpriteFont, or something like that? It would appear like fullscreen but be much wider in compatibility than trying a real text-mode fullscreen.