仅供参考#include
#include
voidConPrint(char*CharBuffer,intlen);
voidConPrintAt(intx,inty,char*CharBuffer,intlen);
voidgotoXY(intx,inty);
voidClearConsole(void);
voidClearConsoleToColors(intForgC,intBackC);
voidSetColorAndBackground(intForgC,intBackC);
voidSetColor(intForgC);
voidHideTheCursor(void);
voidShowTheCursor(void);
intmain(intargc,char*argv[])
{
HideTheCursor();
ClearConsoleToColors(15,1);
ClearConsole();
gotoXY(1,1);
SetColor(14);
printf("Thisisatest...\n");
Sleep(5000);
ShowTheCursor();
SetColorAndBackground(15,12);
ConPrint("Thisisalsoatest...\n",23);
SetColorAndBackground(1,7);
ConPrintAt(22,15,"Thisisalsoatest...\n",23);
gotoXY(0,24);
SetColorAndBackground(7,1);
return0;
}
//Thiswillcleartheconsolewhilesettingtheforgroundand
//backgroundcolors.
voidClearConsoleToColors(intForgC,intBackC)
{
WORDwColor=((BackC&0x0F)
Linux下使用NCURSES库。 |