Monday, July 27, 2009

How do you modify the screen buffer size of command prompt window using C++?

Using C++, after compilation of my code, it will display more than


80 characters in a line in the command prompt window such that some of the characters will appear in the next line. However, I need the characters to appear on the same line without editing the properties of the command prompt window manually. Any one have any codes in C++ that can do that?

How do you modify the screen buffer size of command prompt window using C++?
There is no easy way to do that. The command prompt window is not accessible using any kind of standard library. You'd have to use the Windows API/MFC to modify the properties of the command prompt window, call the program again but using something like a command line switch to indicate the command prompt window has been resized, then set the properties of the command prompt window back when the program closes.
Reply:you cannot do it.


No comments:

Post a Comment