ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

cls.c
Go to the documentation of this file.
00001 /*
00002  *  CLS.C - clear screen internal command.
00003  *
00004  *
00005  *  History:
00006  *
00007  *    07/27/1998 (John P. Price)
00008  *        started.
00009  *
00010  *    27-Jul-1998 (John P Price <linux-guru@gcfl.net>)
00011  *        added config.h include
00012  *
00013  *    04-Dec-1998 (Eric Kohl)
00014  *        Changed to Win32 console app.
00015  *
00016  *    08-Dec-1998 (Eric Kohl)
00017  *        Added help text ("/?").
00018  *
00019  *    14-Jan-1998 (Eric Kohl)
00020  *        Unicode ready!
00021  *
00022  *    20-Jan-1998 (Eric Kohl)
00023  *        Redirection ready!
00024  *
00025  *    02-Apr-2005 (Magnus Olsen) <magnus@greatlord.com>)
00026  *        Remove all hardcode string to En.rc
00027  */
00028 
00029 #include <precomp.h>
00030 
00031 #ifdef INCLUDE_CMD_CLS
00032 
00033 INT cmd_cls (LPTSTR param)
00034 {
00035     HANDLE hOutput = GetStdHandle(STD_OUTPUT_HANDLE);
00036     CONSOLE_SCREEN_BUFFER_INFO csbi;
00037     COORD coPos;
00038     DWORD dwWritten;
00039 
00040     if (!_tcsncmp (param, _T("/?"), 2))
00041     {
00042         ConOutResPaging(TRUE,STRING_CLS_HELP);
00043         return 0;
00044     }
00045 
00046     if (GetConsoleScreenBufferInfo(hOutput, &csbi))
00047     {
00048         coPos.X = 0;
00049         coPos.Y = 0;
00050         FillConsoleOutputAttribute(hOutput, csbi.wAttributes,
00051                                    csbi.dwSize.X * csbi.dwSize.Y,
00052                                    coPos, &dwWritten);
00053         FillConsoleOutputCharacter(hOutput, _T(' '),
00054                                    csbi.dwSize.X * csbi.dwSize.Y,
00055                                    coPos, &dwWritten);
00056         SetConsoleCursorPosition(hOutput, coPos);
00057     }
00058     else
00059     {
00060         ConOutChar(_T('\f'));
00061     }
00062 
00063     return 0;
00064 }
00065 #endif

Generated on Wed May 23 2012 04:16:16 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.