Emulate the dos cmd 'cls'.

This commit is contained in:
Jason Edmeades 2002-04-29 17:12:57 +00:00 committed by Alexandre Julliard
parent 6138ba089f
commit a4c214e736
1 changed files with 13 additions and 1 deletions

View File

@ -57,8 +57,20 @@ extern DWORD errorlevel;
void WCMD_clear_screen () {
WCMD_output (nyi);
/* Emulate by filling the screen from the top left to bottom right with
spaces, then moving the cursor to the top left afterwards */
COORD topLeft;
long screenSize;
CONSOLE_SCREEN_BUFFER_INFO consoleInfo;
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
GetConsoleScreenBufferInfo(hStdOut, &consoleInfo);
screenSize = consoleInfo.dwSize.X * (consoleInfo.dwSize.Y + 1);
topLeft.X = 0;
topLeft.Y = 0;
FillConsoleOutputCharacter(hStdOut, ' ', screenSize, topLeft, &screenSize);
SetConsoleCursorPosition(hStdOut, topLeft);
}
/****************************************************************************