Console WIndos Size
-
I wanted to use a Console Window to output some debug information for my MFC application, that all works fine, but would like to make the Window a bit larger without having to modify the properties of the Console WIndow by hand each time. I tried this bit of code as the Console was being created - but did not work.
AllocConsole();
m_hConsole = GetStdHandle( STD_OUTPUT_HANDLE );
int handle = _open_osfhandle( (long) m_hConsole, _O_TEXT );
m_fConsole = _fdopen( handle, "w" );
// Try and set the Window to this size !!!!!!!!!!!!!
dwSize.X = 120;
dwSize.Y = 50;
SetConsoleScreenBufferSize(m_hConsole, dwSize);Any sugegstions please Andy.
-
I wanted to use a Console Window to output some debug information for my MFC application, that all works fine, but would like to make the Window a bit larger without having to modify the properties of the Console WIndow by hand each time. I tried this bit of code as the Console was being created - but did not work.
AllocConsole();
m_hConsole = GetStdHandle( STD_OUTPUT_HANDLE );
int handle = _open_osfhandle( (long) m_hConsole, _O_TEXT );
m_fConsole = _fdopen( handle, "w" );
// Try and set the Window to this size !!!!!!!!!!!!!
dwSize.X = 120;
dwSize.Y = 50;
SetConsoleScreenBufferSize(m_hConsole, dwSize);Any sugegstions please Andy.
Hi, on WinXP the layout tab of the console allows you to modify its buffer and window size, and to make these changes permanent for all future console windows with the same title. on Vista the option is gone, it just always does it that way. So for both: do it once manually, then keep the title constant. :)
Luc Pattyn [Forum Guidelines] [My Articles]
Voting for dummies? No thanks. X|