Консоль VC
От: Murmansk  
Дата: 05.07.02 11:44
Оценка:
Народ, кто знает как в консоли VC 6 очиcтеть экран, clrscr() в conio.h нет?
Re: Консоль VC
От: Odi$$ey Россия http://malgarr.blogspot.com/
Дата: 05.07.02 11:57
Оценка: 5 (1)
Здравствуйте Murmansk, Вы писали:

M>Народ, кто знает как в консоли VC 6 очиcтеть экран, clrscr() в conio.h нет?


http://www.rsdn.ru/forum/?mid=55148
Автор: ak_alex
Дата: 17.05.02
Re: Консоль VC
От: Nicolay Россия  
Дата: 04.09.02 10:31
Оценка:
Здравствуйте Murmansk, Вы писали:

M>Народ, кто знает как в консоли VC 6 очиcтеть экран, clrscr() в conio.h нет?

А почему бы тебе просто не вывести много пустых срок!
Re: Консоль VC
От: YuriS Германия www.yuris.de
Дата: 04.09.02 10:54
Оценка:
Здравствуйте Murmansk, Вы писали:

M>Народ, кто знает как в консоли VC 6 очиcтеть экран, clrscr() в conio.h нет?


/************************************************************************
* FUNCTION: cls(HANDLE hConsole)                                        *
*                                                                       *
* PURPOSE: clear the screen by filling it with blanks, then home cursor *
*                                                                       *
* INPUT: the console buffer to clear                                    *
*                                                                       *
* RETURNS: none                                                         *
*************************************************************************/

void cls(HANDLE hConsole)
{
  COORD coordScreen = { 0, 0 }; /* here's where we'll home the cursor */
  BOOL bSuccess;
  DWORD cCharsWritten;
  CONSOLE_SCREEN_BUFFER_INFO csbi; /* to get buffer info */
  DWORD dwConSize; /* number of character cells in the current buffer */

  /* get the number of character cells in the current buffer */
  bSuccess = GetConsoleScreenBufferInfo(hConsole, &csbi);
  PERR(bSuccess, "GetConsoleScreenBufferInfo");
  dwConSize = csbi.dwSize.X * csbi.dwSize.Y;
  /* fill the entire screen with blanks */
  bSuccess = FillConsoleOutputCharacter(hConsole, (TCHAR) ' ',
      dwConSize, coordScreen, &cCharsWritten);
  PERR(bSuccess, "FillConsoleOutputCharacter");
  /* get the current text attribute */
  bSuccess = GetConsoleScreenBufferInfo(hConsole, &csbi);
  PERR(bSuccess, "ConsoleScreenBufferInfo");
  /* now set the buffer's attributes accordingly */
  bSuccess = FillConsoleOutputAttribute(hConsole, csbi.wAttributes,
      dwConSize, coordScreen, &cCharsWritten);
  PERR(bSuccess, "FillConsoleOutputAttribute");
  /* put the cursor at (0, 0) */
  bSuccess = SetConsoleCursorPosition(hConsole, coordScreen);
  PERR(bSuccess, "SetConsoleCursorPosition");
  return;
}
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.