#include < windows.h >
void clrscr(void);
void clreol(void);
void clreoscr(void);
void gotoxy(int ,int );
// --- Funktionsimplementierung
/*********************************************************************************/
void clrscr(void) //clearscreen: gesamten Bildschirm leeren
{
CONSOLE_SCREEN_BUFFER_INFO csbiInfo; //variablendklaration
HANDLE hConsoleOut;
COORD Home = {0,0};
DWORD dummy;
hConsoleOut = GetStdHandle(STD_OUTPUT_HANDLE);
GetConsoleScreenBufferInfo(hConsoleOut,&csbiInfo);
FillConsoleOutputCharacter(hConsoleOut,' ',csbiInfo.dwSize.X * csbiInfo.dwSize.Y,Home,&dummy); //bis cursorposition leerzeichen ausgeben
csbiInfo.dwCursorPosition.X = 0; //cursorposition X koordinate festlegen
csbiInfo.dwCursorPosition.Y = 0; //cursorposition Y koordinate festlegen
SetConsoleCursorPosition(hConsoleOut,csbiInfo.dwCursorPosition); //den cursor an die festgelegte koordinate setzen
}
/*********************************************************************************/
void clreol(void) //clear end of line: den rest der Zeile nach dem cursor l鰏chen
{
CONSOLE_SCREEN_BUFFER_INFO csbiInfo; //variablendklaration
HANDLE hConsoleOut;
COORD Home,pos;
DWORD dummy;
hConsoleOut = GetStdHandle(STD_OUTPUT_HANDLE);
GetConsoleScreenBufferInfo(hConsoleOut,&csbiInfo);
Home = csbiInfo.dwCursorPosition;
pos.X = 80 - csbiInfo.dwCursorPosition.X;
FillConsoleOutputCharacter(hConsoleOut,' ',pos.X,Home,&dummy);
}
/*********************************************************************************/
void clreoscr(void) //clear end of screen: alles nach dem cursor l鰏chen
{
CONSOLE_SCREEN_BUFFER_INFO csbiInfo; //variablendklaration
HANDLE hConsoleOut;
COORD Home;
DWORD dummy;
hConsoleOut = GetStdHandle(STD_OUTPUT_HANDLE);
GetConsoleScreenBufferInfo(hConsoleOut,&csbiInfo);
Home=csbiInfo.dwCursorPosition;
FillConsoleOutputCharacter(hConsoleOut,' ',csbiInfo.dwSize.X * csbiInfo.dwSize.Y,Home,&dummy);
}
/*********************************************************************************/
void gotoxy(int x,int y) //cursor an gewuenschte position auf dem bildschirm setzen
{
CONSOLE_SCREEN_BUFFER_INFO csbiInfo; //variablendklaration
HANDLE hConsoleOut;
hConsoleOut = GetStdHandle(STD_OUTPUT_HANDLE);
GetConsoleScreenBufferInfo(hConsoleOut,&csbiInfo);
csbiInfo.dwCursorPosition.X = x; //cursorposition X koordinate festlegen
csbiInfo.dwCursorPosition.Y = y; //cursorposition Y koordinate festlegen
SetConsoleCursorPosition(hConsoleOut,csbiInfo.dwCursorPosition); //den cursor an die festgelegte koordinate setzen
}
用户24118 2008-3-26 18:50
用户200271 2007-5-16 13:31
太枯燥拉
用户25031 2006-10-15 12:49
miaozengxue_503596631 2006-10-15 12:45
这个是256还是128呢,我看过好多书,说什么的都有128还是多一点的,但不论是128还是256只要知道了内部结构才是最重要的啊,谢谢啊,有时间交流一下哦
用户1053025 2006-10-11 11:45
顶
tomsunzhuang_396962985 2006-10-2 16:09