Each time I run this code ( on Win7) the console gets 1 character smaller in both directions.
int wmain( INT argc, WCHAR **argv )
{
CONSOLE_SCREEN_BUFFER_INFOEX csbi;
csbi.cbSize = sizeof(CONSOLE_SCREEN_BUFFER_INFOEX);
GetConsoleScreenBufferInfoEx(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
wprintf(L"Window: %u x %u\n", csbi.srWindow.Right - csbi.srWindow.Left + 1, csbi.srWindow.Bottom - csbi.srWindow.Top + 1);
SetConsoleScreenBufferInfoEx(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
return 0;
}
I doubt that's expected behavior. Is it documented? Is it any better in newer versions of Windows? Here's a clip of running it a few times.
p:\test\release> test.exe
Window: 99 x 41
p:\test\release> test.exe
Window: 98 x 40
p:\test\release> test.exe
Window: 97 x 39