Hi everyone,
I'm stuck trying to get a Console application to behave consistently. Specifically, I can't get calls to SetConsoleWindowInfo to produce a window that is always the right size on the screen - every now and then it comes up much smaller than I want, with scrollbars to move around the little window.
Here is a segment of code which I'm using to have 5 attempts at the resize. SCWI() is just a call to SetConsoleWindowInfo with some debugging calls in.
for( max_tries = 1; max_tries <= 5; max_tries++ )
{
srWindowRect.Top = 0;
srWindowRect.Left = 0;
srWindowRect.Right = 79;
srWindowRect.Bottom = 23;
sprintf( SC_buffer, "RWTM (#%d)", max_tries );
SCWI(Screen, TRUE, &srWindowRect);
GetConsoleScreenBufferInfo(Screen, &csbi);
if( csbi.srWindow.Left == 0 && csbi.srWindow.Top == 0 &&
csbi.srWindow.Right == 79 && csbi.srWindow.Bottom == 23 )
{
sprintf( SC_buffer, "RWTM (#%d) Succeeded", max_tries );
w32logmessage( SC_buffer );
return;
}
}
The app is developed in C++ under MS Visual Studio version 6.
Thanks for any helpful thoughts...
I'm stuck trying to get a Console application to behave consistently. Specifically, I can't get calls to SetConsoleWindowInfo to produce a window that is always the right size on the screen - every now and then it comes up much smaller than I want, with scrollbars to move around the little window.
Here is a segment of code which I'm using to have 5 attempts at the resize. SCWI() is just a call to SetConsoleWindowInfo with some debugging calls in.
for( max_tries = 1; max_tries <= 5; max_tries++ )
{
srWindowRect.Top = 0;
srWindowRect.Left = 0;
srWindowRect.Right = 79;
srWindowRect.Bottom = 23;
sprintf( SC_buffer, "RWTM (#%d)", max_tries );
SCWI(Screen, TRUE, &srWindowRect);
GetConsoleScreenBufferInfo(Screen, &csbi);
if( csbi.srWindow.Left == 0 && csbi.srWindow.Top == 0 &&
csbi.srWindow.Right == 79 && csbi.srWindow.Bottom == 23 )
{
sprintf( SC_buffer, "RWTM (#%d) Succeeded", max_tries );
w32logmessage( SC_buffer );
return;
}
}
The app is developed in C++ under MS Visual Studio version 6.
Thanks for any helpful thoughts...