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
| void ClearScreen(void)
{
#if defined(UTILISE_NCURSES)
clear();
move (0,0);
#elif defined(_Windows)
/* Début : (1,1) */
HANDLE HdlConsole = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_SCREEN_BUFFER_INFO Info;
COORD Debut;
DWORD NbrOctetEcrit;
Debut.X = 0;
Debut.Y = 0;
/* Lit les infos sur le buffer */
GetConsoleScreenBufferInfo (HdlConsole, &Info);
/* Remplit l'écran avec le caractère espace : ' ' */
FillConsoleOutputCharacter (HdlConsole, ' ', Info.dwSize.X*Info.dwSize.Y, Debut, &NbrOctetEcrit);
/* Positionne le curseur */
SetConsoleCursorPosition (HdlConsole,Debut);
#elif defined(__MSDOS__)
union REGS inregs, outregs;
struct SREGS segregs;
inregs.h.ah = 0x00; /* Fonction 00h : Change de mode video */
inregs.h.ah = 0x03; /* Mode = 03h : 80x25 caracteres, 16 couleurs */
int86x(0x10, &inregs, &outregs, &segregs); /* Interruption 10h : Video */
#endif
} |
Partager