mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 14:43:22 +00:00
- Implement CMD /A and /U switches.
- CLS: Fill console with current color rather than original; if standard output is not a console, print a form-feed character. - COLOR: If standard output is not a console, do nothing. svn path=/trunk/; revision=40272
This commit is contained in:
parent
23cb0510c4
commit
4e02761261
4 changed files with 62 additions and 82 deletions
|
@ -32,6 +32,7 @@
|
|||
|
||||
INT cmd_cls (LPTSTR param)
|
||||
{
|
||||
HANDLE hOutput = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||
COORD coPos;
|
||||
DWORD dwWritten;
|
||||
|
@ -42,17 +43,22 @@ INT cmd_cls (LPTSTR param)
|
|||
return 0;
|
||||
}
|
||||
|
||||
GetConsoleScreenBufferInfo(hConsole, &csbi);
|
||||
|
||||
coPos.X = 0;
|
||||
coPos.Y = 0;
|
||||
FillConsoleOutputAttribute(hConsole, wColor,
|
||||
csbi.dwSize.X * csbi.dwSize.Y,
|
||||
coPos, &dwWritten);
|
||||
FillConsoleOutputCharacter(hConsole, _T(' '),
|
||||
csbi.dwSize.X * csbi.dwSize.Y,
|
||||
coPos, &dwWritten);
|
||||
SetConsoleCursorPosition(hConsole, coPos);
|
||||
if (GetConsoleScreenBufferInfo(hOutput, &csbi))
|
||||
{
|
||||
coPos.X = 0;
|
||||
coPos.Y = 0;
|
||||
FillConsoleOutputAttribute(hOutput, csbi.wAttributes,
|
||||
csbi.dwSize.X * csbi.dwSize.Y,
|
||||
coPos, &dwWritten);
|
||||
FillConsoleOutputCharacter(hOutput, _T(' '),
|
||||
csbi.dwSize.X * csbi.dwSize.Y,
|
||||
coPos, &dwWritten);
|
||||
SetConsoleCursorPosition(hOutput, coPos);
|
||||
}
|
||||
else
|
||||
{
|
||||
ConOutChar(_T('\f'));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue