Windows编程MessageBox函数

API:

int MessageBox(HWND hWnd, LPCTSTRlpText, LPCTSTRlpCaption, UINTuType);

MSDN描述:

This function creates, displays, and operates a message box. The message box contains an application-defined message and title, plus any combination of predefined icons and push buttons.

这个API方法用来创建、显示、操作一个消息框。它包含可设置的消息内容、标题,还可以添加预定义的图标、放置按钮。

参数说明:

MSDN描述:

hWnd

[in] Handle to the owner window of the message box to be created. If this parameter is NULL, the message box has no owner window.

输入参数:指定消息框的父窗口(消息框显示时,父窗口被禁用)。如果这个参数为空,说明消息框没有父窗口,即、没有窗口会因为消息框的出现而被禁用。

参数类型:HWND类型是结构体指针,结构体成员只有一个int。参考MSND的窗口描述符。

lpText

[in] Long pointer to a null-terminated string that contains the message to be displayed.

参数类型: LPCTSTR 字符串指针。

输入参数:指定消息框的消息内容。

lpCaption

[in] Long pointer to a null-terminated string used for the dialog box title. If this parameter is NULL, the default title Error is used.

输入参数:指定消息框的标题。默认值是 Error 或 错误 。

参数类型:LPCTSTR字符串指针。

uType

[in] Specifies a set of bit flags that determine the contents and behavior of the dialog box. This parameter can be a combination of flags from the following groups of flags.

输入参数:指定消息和消息框的显示风格。可按位组合指定多种风格。具体风格参见MSDN。

参数类型: 无符号整形。一般传入的是一组用 || 连接的宏。

返回值

             返回0,说明创建、显示消息框失败。

             返回非0,说明消息框操作成功。具体返回值含义如下:

            

ValueDescription
IDABORTAbort button was selected.用户点击了中止按钮)
IDCANCELCancel button or the close button on the title bar was selected.
(用户点击了取消按钮、或者标题栏关闭按钮、或按下ESC键)
IDIGNOREIgnore button was selected.(用户点击了忽略按钮)
IDNONo button was selected.(用户点击了否按钮)
IDOKOK button was selected.(用户点击了是按钮)
IDRETRYRetry button was selected.(用户点击了重试按钮)
IDYESYes button was selected.(用户点击了确定按钮)
来自:http://furzoom.com/ 转载请注明。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

枫竹梦

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值