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.
- uType
输入参数:指定消息框的标题。默认值是 Error 或 错误 。
参数类型:LPCTSTR字符串指针。
[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,说明消息框操作成功。具体返回值含义如下:
Value | Description |
---|---|
IDABORT | Abort button was selected.(用户点击了中止按钮) |
IDCANCEL | Cancel button or the close button on the title bar was selected. (用户点击了取消按钮、或者标题栏关闭按钮、或按下ESC键) |
IDIGNORE | Ignore button was selected.(用户点击了忽略按钮) |
IDNO | No button was selected.(用户点击了否按钮) |
IDOK | OK button was selected.(用户点击了是按钮) |
IDRETRY | Retry button was selected.(用户点击了重试按钮) |
IDYES | Yes button was selected.(用户点击了确定按钮) |
最新文章
- 从零开始学 Java - CentOS 安装 JDK
- Logging configuration
- poi导出word、excel
- Linux下编译安装Apache 2.4
- asp.net mvc 动态显示不同的部分视图
- poj 1273 Drainage Ditches 最大流入门题
- Oracle用户及角色的权限管理[Oracle基础]
- hdu2007
- C++ 查找文件夹下的文件
- C++类对象大小的计算
- 老李分享:Web Services 组件 1
- c/c++ 多线程 一个线程等待某种事件发生
- (转!)Pyinstaller 打包发布经验总结
- 安装VisualSVN Server 报";Service 'VisualSVN Server' failed to start. Please check VisualSVN Server log in Event Viewer for more details";错误.原因是启动";VisualSVN Server";失败
- 粒子群算法(PSO)算法解析(简略版)
- SlickOne 敏捷开发框架介绍(二) -- 多用户/多租户/SAAS软件基础框架实现
- Packagist 镜像使用方法--composer
- luoguP2574 XOR的艺术
- stimulsoft report工具—— 简单的多表连接打印报表例子
- JMeter连接数据库(查询出的数据作为参数)