development/Common/Utility/source/MainConsole.cpp
//This will clear the console.
This will clear the console.
This will clear the console .
void MainConsole::ClearConsole()
{
    HANDLE hStdOut = ::GetStdHandle(STD_OUTPUT_HANDLE);
    COORD coord = {0, 0};
    DWORD count;
    CONSOLE_SCREEN_BUFFER_INFO csbi;
    if(::GetConsoleScreenBufferInfo(hStdOut, &csbi))
    {
        ::FillConsoleOutputCharacter(hStdOut, (TCHAR) 32, csbi.dwSize.X * csbi.dwSize.Y, coord, &count);
        ::FillConsoleOutputAttribute(hStdOut, csbi.wAttributes, csbi.dwSize.X * csbi.dwSize.Y, coord, &count );
        ::SetConsoleCursorPosition(hStdOut, coord);
    }
    return;
}
void MainConsole :: ClearConsole ( ) { HANDLE hStdOut = :: GetStdHandle ( STD_OUTPUT_HANDLE ) ; COORD coord = { 0 , 0 } ; DWORD count ; CONSOLE_SCREEN_BUFFER_INFO csbi ; if ( :: GetConsoleScreenBufferInfo ( hStdOut , & csbi ) ) { :: FillConsoleOutputCharacter ( hStdOut , ( TCHAR ) 32 , csbi . dwSize . X * csbi . dwSize . Y , coord , & count ) ; :: FillConsoleOutputAttribute ( hStdOut , csbi . wAttributes , csbi . dwSize . X * csbi . dwSize . Y , coord , & count ) ; :: SetConsoleCursorPosition ( hStdOut , coord ) ; } return ; }
This will clear the console.
This will clear the console .
//Get the handle to the current output buffer... //This is used to reset the carat/cursor to the top left. //A return value... indicating how many chars were written //   not used but we need to capture this since it will be //   written anyway (passing NULL causes an access violation). //This is a structure containing all of the console info // it is used here to find the size of the console. //Here we will set the current color //This fills the buffer with a given character (in this case 32=space). //This will set our cursor position for the next print statement.