Guest User

Untitled

a guest
Feb 22nd, 2013
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.59 KB | None | 0 0
  1. procedure Cls;
  2. var
  3.   Coords: TCoord;
  4.   Handle: THandle;
  5.   CellCnt: DWORD;
  6.   Written: DWORD;
  7.   BufferInfo: TConsoleScreenBufferInfo;  
  8. begin
  9.   Coords.X := 0;
  10.   Coords.Y := 0;
  11.   Handle := GetStdHandle(STD_OUTPUT_HANDLE);
  12.  
  13.   GetConsoleScreenBufferInfo(Handle, BufferInfo);
  14.   CellCnt := BufferInfo.dwSize.X * BufferInfo.dwSize.Y;
  15.   FillConsoleOutputCharacter(Handle, ' ', CellCnt, Coords, Written);
  16.   GetConsoleScreenBufferInfo(Handle, BufferInfo);
  17.   FillConsoleOutputAttribute(Handle, BufferInfo.wAttributes, CellCnt, Coords,
  18.     Written);
  19.   SetConsoleCursorPosition(Handle, Coords);
  20. end;
Advertisement
Add Comment
Please, Sign In to add comment