Skip to content

Instantly share code, notes, and snippets.

@KaeLL
Last active May 5, 2016 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaeLL/6050345 to your computer and use it in GitHub Desktop.
Save KaeLL/6050345 to your computer and use it in GitHub Desktop.
Primeira versão de alterações!
#include <Windows.h>
void cls()
{
COORD coordScreen = { 0, 0 };
DWORD dwConSize,
cCharsWritten;
CONSOLE_SCREEN_BUFFER_INFO csbi;
if ( !GetConsoleScreenBufferInfo( GetStdHandle( STD_OUTPUT_HANDLE ), &csbi )) return;
dwConSize = csbi.dwSize.X * csbi.dwSize.Y;
if ( !FillConsoleOutputCharacter( GetStdHandle( STD_OUTPUT_HANDLE ), ( TCHAR )' ', dwConSize, coordScreen, &cCharsWritten )) return;
if ( !GetConsoleScreenBufferInfo( GetStdHandle( STD_OUTPUT_HANDLE ), &csbi )) return;
if ( !FillConsoleOutputAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten )) return;
SetConsoleCursorPosition( GetStdHandle( STD_OUTPUT_HANDLE ), coordScreen );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment