第一个对话框

// DEMO2_2.CPP - a simple message box
#define WIN32_LEAN_AND_MEAN  //这句的目的是指示编译器不要包含与MFC相关的操作。

#include <windows.h>        // the main windows headers
#include <windowsx.h>       // a lot of cool macros

// main entry point for all windows programs
int WINAPI WinMain(HINSTANCE hinstance,
          HINSTANCE hprevinstance,
          LPSTR lpcmdline,
          int ncmdshow)
{
// call message box api with NULL for parent window handle
MessageBox(NULL, "对话框内容",
                 "标题",
                  MB_ABORTRETRYIGNORE | MB_ICONEXCLAMATION);

// exit program
return(0);

} // end WinMain


MessageBox(窗体句柄,内容,标题,按钮样式|图标)

其中对话框弹出的内容有

  • MB_ABORTRETRYIGNORE   The message box contains three pushbuttons: Abort, Retry, and Ignore.(终止重试忽略)

  • MB_OK   The message box contains one pushbutton: OK.

  • MB_OKCANCEL   The message box contains two pushbuttons: OK and Cancel.

  • MB_RETRYCANCEL   The message box contains two pushbuttons: Retry and Cancel.

  • MB_YESNO   The message box contains two pushbuttons: Yes and No.

  • MB_YESNOCANCEL   The message box contains three pushbuttons: Yes, No, and Cancel.

对话框图标:

  • MB_ICONEXCLAMATION   An exclamation-point icon appears in the message box.(!)

  • MB_ICONINFORMATION   An icon consisting of an "I" in a circle appears in the message box.(infomation信息)

  • MB_ICONQUESTION   A question-mark icon appears in the message box.(?)

  • MB_ICONSTOP   A stop-sign icon appears in the message box.(X)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值