- /* Resize the console */
- ConRect.Left = 0;
- ConRect.Top = ConsoleInfo.srWindow.Top;
- ConRect.Right = ConRect.Left + Resolution->X - 1;
- ConRect.Bottom = ConRect.Top + Resolution->Y - 1;
- /*
- * Use this trick to effectively resize the console buffer and window,
- * because:
- * - SetConsoleScreenBufferSize fails if the new console screen buffer size
- * is smaller than the current console window size, and:
- * - SetConsoleWindowInfo fails if the new console window size is larger
- * than the current console screen buffer size.
- */
- SetConsoleScreenBufferSize(TextConsoleBuffer, *Resolution);
- SetConsoleWindowInfo(TextConsoleBuffer, TRUE, &ConRect);
- SetConsoleScreenBufferSize(TextConsoleBuffer, *Resolution);
- /* Update the saved console information */
- GetConsoleScreenBufferInfo(TextConsoleBuffer, &ConsoleInfo);
-
- /* Adjust the text framebuffer if we changed resolution */