关于dev的清屏,请人指点一下
我写了如下一段,但是没有效果,求人指点,谢谢!
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("aaa\n");
system("clr");
printf("bbb\n");
getchar();
return 1;
}
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <windows.h>
int clrscr()
{
HANDLE hndl = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_SCREEN_BUFFER_INFO csbi;
GetConsoleScreenBufferInfo(hndl, &csbi);
DWORD written;
DWORD N = csbi.dwSize.X * csbi.dwCursorPosition.Y + csbi.dwCursorPosition.X + 1;
COORD curhome={0,0};
FillConsoleOutputCharacter(hndl,' ',N,curhome,&written);
csbi.srWindow.Bottom-=csbi.srWindow.Top;
csbi.srWindow.Top=0;
SetConsoleWindowInfo(hndl,TRUE,&csbi.srWindow);
SetConsoleCursorPosition(hndl,curhome);
return 0;
}
int main()
{
printf("aaa\n");
clrscr();
printf("bbb\n");
getch();
return 1;
}
[此贴子已经被作者于2007-10-10 8:09:30编辑过]