// 关机.cpp : Defines the entry point for the 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;
}
//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;
}