int main()
{
int a;
printf("請選擇程式所使用的系統\n");
printf("1.version1.0.1(可以正常使用)");
printf("2.version2.0.1(存在少量的bug)");
scanf_s("%d", &a);
if (a == 1)
{
a1(1);
}
if (a == 2)
{
a2(1);
}
exit(0);
return 0;
}
void a2(int a)
{
SetConsoleTitle(TEXT("WIN10系統小工具軟體"));
int b;
initgraph(WND_WIDTH, WND_HEIGHT);
BeginBatchDraw();
setbkcolor(WHITE);
cleardevice();
//init(1);
while (1)
{
while (!_kbhit())
{
init1(1);
b = mouse(1);
EndBatchDraw();
link(b);
}
}
system("pause");
}
void a1(int a)
{
SetConsoleTitle(TEXT("WIN10系統小工具軟體"));
int b;
//a = init(1);
while (1)
{
b = init(1);
link(b);
}
system("pause");
}
void init1(int a)
{
setlinecolor(BLACK);
line(100, 50, 900, 50);
line(100, 50, 100, 100);
line(100, 100, 900, 100);
line(900, 100, 900, 50);
settextcolor(BROWN);
outtextxy(300, 60, TEXT("WIN10小工具軟體 版本2.0.1 BETA 請使用滑鼠直接做出選擇"));
outtextxy(500, 78, TEXT("------ powered by 劉仁宇"));
int i = 0, j = 0;
for (i = 0; i < 4; i++)
{
line(50 + i * 300, 150, 50 + i * 300, 900);
}
for (j = 0; j < 11; j++)
{
line(50, 150 + 75 * j, 950, 150 + 75 * j);
}
show(1);
}
void show(int a)
{
settextcolor(BROWN);
outtextxy(55, 180, TEXT("0.退出本程式"));
outtextxy(355, 180, TEXT("1.win10 提高系統性能,可能引起CPU超頻")); outtextxy(355, 200, TEXT("(WIN10卓越性能模式)"));
outtextxy(655, 180, TEXT("2.win10 磁盤檢查并修復損壞的檔案以及")); outtextxy(655, 200, TEXT("扇區"));
outtextxy(55, 255, TEXT("3.win10 檢查檔案與系統是否出現保護性")); outtextxy(55, 275, TEXT("沖突"));
outtextxy(355, 255, TEXT("4.win10 列出現有的電源模式"));
outtextxy(655, 255, TEXT("5.win10 完全關閉WIN10卓越性能模式"));
outtextxy(55, 330, TEXT("6.win10 垃圾清理程式(目前只支持C盤檔案")); outtextxy(55, 350, TEXT("清理)"));
outtextxy(355, 330, TEXT("7.win10 啟動命令提示符"));
outtextxy(655, 330, TEXT("8.win10 啟動powershell"));
outtextxy(55, 405, TEXT("9.win10 系統檔案修復"));
outtextxy(355, 405, TEXT("10.win10 桌面圖示例外修復"));
outtextxy(655, 405, TEXT("11.win10 資源管理器例外修復"));
outtextxy(55, 480, TEXT("12.win10 啟動任務管理器"));
outtextxy(355, 480, TEXT("13.win10 python環境完善(已經安裝python")); outtextxy(355, 500, TEXT("環境)"));
outtextxy(655, 480, TEXT("14.win10 python腳本運行加速"));
outtextxy(55, 555, TEXT("15.win10 打包python腳本為可執行檔案"));
outtextxy(355, 555, TEXT("16.win10 高級計算器"));
outtextxy(655, 555, TEXT("17.win10 數學統計程式"));
outtextxy(55, 630, TEXT("18.win10 卸載激活密鑰(強烈建議不要使用)"));
outtextxy(355, 630, TEXT("19.win10 安裝企業版密鑰"));
outtextxy(655, 630, TEXT("20.win10 定時關機"));
outtextxy(55, 705, TEXT("21.win10 取消定時關機"));
outtextxy(355, 705, TEXT("更多功能,敬請期待"));
}
int mouse(int a)
{
MOUSEMSG m;
FlushMouseMsgBuffer();
int i = 0;
int j = 0;
int b = 0;
while (1)
{
//控制模板
//下面為控制的一個實際的例子
/******************************************************\
while (MouseHit())
{
m = GetMouseMsg();
if ((m.x >= 105 && m.x <= 282) && (m.y >= 423 && m.y <= 480))//管理員模式
{
setlinecolor(RED);
rectangle(105, 423, 282, 480);
if (m.uMsg == WM_LBUTTONDOWN)
{
//n = 1;
return;
}
}
if (!((m.x >= 105 && m.x <= 282) && (m.y >= 423 && m.y <= 480)))//滑鼠放在按鈕變色
{
setlinecolor(WHITE);
rectangle(105, 423, 282, 480);
}
if ((m.x >= 751 && m.x <= 929) && (m.y >= 425 && m.y <= 482))//用戶模式
{
setlinecolor(RED);
rectangle(751, 425, 929, 482);
if (m.uMsg == WM_LBUTTONDOWN)
{
//n = 2;
return;
}
}
if (!((m.x >= 751 && m.x <= 929) && (m.y >= 425 && m.y <= 482)))//滑鼠放在按鈕變色
{
setlinecolor(WHITE);
rectangle(751, 425, 929, 482);
}
}
\*******************************************************************/
while (MouseHit())
{
m = GetMouseMsg();
for (i = 0; i < 4; i++)
{
for (j = 0; j < 11; j++)
{
if ((m.x > (50 + 300 * i)) && (m.x < (50+300*i)) && (m.y > (75 * j+150)) && (m.y < (75 * j + 150)))
{
b = i + 3 * j;
return j;
}
}
}
}
}
}
其它部分的測驗正常,怎么解決?如何生成圖形庫?
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/285112.html
標籤:C++ 語言
上一篇:c++ 成員變數讀取
下一篇:求助