- SetConsoleTextAttribute
BOOL SetConsoleTextAttribute(HANDLE hConsoleOutput, WORD wAttributes);
是一个可以在API(应用程序编程接口)中设置控制台窗口字体颜色和背景色的计算机函数。
实例:
HANDLE hCon = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hCon, 3 | BACKGROUND_RED); - WinExec("E:\\QQ\\Bin\\QQ.exe", WM_SHOWWINDOW);
启动指定路径应用程序。 - 测试代码所用时间
#include <time.h>
clock_t start, end;
start = clock();
//测试代码
//……
end = clock();
double totaltime = (double)(end-start)/CLOCKS_PER_SEC;
- 清除屏幕 system("cls");