Friday, March 4, 2011

Console application leaves cmd.exe set size.

I have written a console application that sets the size of the console and output buffer. My problem is that after the program ends I cannot resize my cmd.exe window the way I did before. After the program sets the size of the window it retains that size no matter what I do afterwards.

From stackoverflow
  • It works for me in C#.

    namespace CSharpTest
    {
        class Program
        {
            static void Main(string[] args)
            {
                System.Console.WindowHeight = 50;
                System.Console.WindowWidth = 100;
                System.Console.BufferHeight = 6000;
                System.Console.BufferWidth = 100;
            }
        }
    }
    

    After running the program, I can change the height of the window and make it narrower, just like before. I can't make it wider, but then I couldn't before, either.

  • It is not clear what you mean. But are you setting the default values for all Cmd consoles when you change the size - That would make new cmd consoles that size too.

    Could we have a bit more information about what you mean please.

0 comments:

Post a Comment