Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the dimensions of the Windows CMD/Command Prompt?

Tags:

c#

cmd

I know that the Command Prompt is 80 characters across and 300 characters down by default. Here's the difficulty: I'm trying to create a C# WinForms window that is the exact same size as the command prompt window. What width and height should I use to get the window to be the same size?

EDIT: All I'm looking for is to recreate the size of the command prompt window with a C# WinForms window. What width/height should I use?

like image 219
Alper Avatar asked Sep 18 '11 06:09

Alper


3 Answers

Default window size should be 80x25. Default buffer size is 80x300.

like image 54
sim642 Avatar answered Oct 19 '22 07:10

sim642


If you have a console process you can call GetConsoleWindow and then GetWindowRect.

like image 28
David Heffernan Avatar answered Oct 19 '22 09:10

David Heffernan


You need to run cmd, take a screenshot, paste the image into an image editor, cut the cmd window, paste it into its own image and then view the size of the new image. That will give you the x and y lengths in pixels.

like image 1
Daniel Pereira Avatar answered Oct 19 '22 09:10

Daniel Pereira