1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
#include <windows.h>
#include <stdio.h>
void cls(HANDLE hStdOutput)
{
COORD coordScreen = {0,0};
DWORD cCharsWritten;
CONSOLE_SCREEN_BUFFER_INFO csbi;
DWORD dwConSize;
GetConsoleScreenBufferInfo(hStdOutput, &csbi);
dwConSize = csbi.dwSize.X * csbi.dwSize.Y;
FillConsoleOutputCharacter(hStdOutput,(TCHAR)' ',dwConSize,coordScreen,&cCharsWritten);
GetConsoleScreenBufferInfo(hStdOutput,&csbi);
FillConsoleOutputAttribute(hStdOutput,csbi.wAttributes,dwConSize, coordScreen,&cCharsWritten);
SetConsoleCursorPosition(hStdOutput,coordScreen);
}
int main()
{
HANDLE hStdOutput;
COORD cd;
hStdOutput=GetStdHandle(STD_OUTPUT_HANDLE);
printf("I've Got Itchy....\n");
printf("...balls!\n");
printf("\n\npress any key to continue....\n");
getchar();
cd.X=0, cd.Y=1;
SetConsoleCursorPosition(hStdOutput,cd);
printf("....feet!\n");
printf("\n\npress any key to continue....\n");
getchar();
printf("\nWill Now Clear Screen!\n");
printf("\n\npress any key to continue....\n");
getchar();
cls(hStdOutput);
return 0;
}
|