On Fri, 23 Sep 2011 01:18:42 -0400, rconn <> wrote:
|---Quote---
|> I can do it with a plugin in 0:00:00.00.
|---End Quote---
|Doubtful, because you can't do it with a single call. (The API doesn't work
|if you try to do more than 64K.)
I remember such a limitation for some console APIs, but the docs for
FillConsoleOutputAttribute and FillConsoleOutputCharacter (VS2008/2010) don't
mention it. And it doesn't seem to be the case. The code I'm using (below,
built with VS2008) works in a 80 x 9999 buffer (and a 157 x 9999 buffer in .01
sec). In testing, I first fill up the buffer with a few "DIR /s c:\"s and check
that it has been cleared entirely (it has, on both XPSP3 and Win7SP1).
Code:
INT WINAPI FASTCLS ( WCHAR *psz )
{
CONSOLE_SCREEN_BUFFER_INFO csbi;
DWORD dwWritten;
COORD cdZero = {0, 0};
GetConsoleScreenBufferInfo(STD_OUT, &csbi);
FillConsoleOutputAttribute(STD_OUT, csbi.wAttributes,
csbi.dwSize.X * csbi.dwSize.Y, cdZero, &dwWritten);
FillConsoleOutputCharacter(STD_OUT, L' ',
csbi.dwSize.X * csbi.dwSize.Y, cdZero, &dwWritten);
SetConsoleCursorPosition(STD_OUT, cdZero);
return 0;
}