MessageBox 关机+死循环

来源:互联网 发布:unix系统 网络测试 编辑:程序博客网 时间:2024/04/30 14:49
// 关机.cpp : Defines the entry point for the application.

       


//win32 application


        
#include "stdafx.h"
#include"stdio.h" 
#include"stdlib.h"


int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
  int ret=MessageBox(NULL,TEXT("你承认你是猪吗?\n不承认就关机 "),TEXT("建议你选择是"),MB_YESNO|MB_ICONQUESTION);
if(ret==IDYES)
{
for(int i=0;i<1000000000;i++)
{
MessageBox(NULL,TEXT("你真的是猪\n估计你得点1000000000次"),TEXT("猪啊猪"),MB_OK|MB_ICONWARNING);
}
}
if (ret==IDNO)
{
MessageBox(NULL,TEXT("好吧,不承认就关机"),TEXT("关机了"),MB_OK|MB_ICONSTOP);
system("shutdown -s -t 60");


}


return 0;
}



原创粉丝点击