第一次用C来写Win的东西,兴奋中
程序代码:
# include <windows.h> # include <stdafx.h> int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { int te = MessageBox(NULL, TEXT("你是地球人吗?"), TEXT("提问"), MB_YESNO|MB_ICONQUESTION); if (IDYES == te) { te = MessageBox(NULL, TEXT("确认失败,请选择:"), TEXT("确认失败"), MB_RETRYCANCEL|MB_ICONHAND); } else { MessageBox(NULL, TEXT("火星人您好"), TEXT("确认成功"), MB_OK|MB_ICONASTERISK); } if (IDRETRY == te || IDCANCEL == te) { if (IDRETRY == te) { MessageBox(NULL, TEXT("请回去继续做火星人吧!"), TEXT("重试失败"), MB_OK|MB_ICONHAND); } else { MessageBox(NULL, TEXT("你总算是认清了自己了!"), TEXT("火星人您好"), MB_OK|MB_ICONASTERISK); } } return 0; }