yumoz

一段程序控制电脑关机

 1 #include<windows.h>
 2 #include<stdio.h>
 3 #include<stdlib.h>
 4 int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPreInstance,LPSTR lpCmdLine,int nShowCmd)
 5 {
 6     int i;
 7     i=MessageBox(NULL,"你确定要关机吗?","系统提示",MB_YESNO);
 8     if(i==IDNO)
 9     {
10         printf("谢谢合作");
11     }
12     else
13     {
14         MessageBox(NULL,"10秒钟后系统自动关机!","系统提示",MB_OK);
15       //    system("shoutdown -s -t 10");//记得 屏蔽这句,不然呢电脑会关机 
16     }
17     return 0;
18 }
View Code

 

posted @ 2018-10-12 22:33  yumoz  阅读(249)  评论(0编辑  收藏  举报