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,说明消息框操作成功。具体返回值含义如下:

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.(用户点击了确定按钮)
来自:http://furzoom.com/ 转载请注明。

最新文章

  1. 从零开始学 Java - CentOS 安装 JDK
  2. Logging configuration
  3. poi导出word、excel
  4. Linux下编译安装Apache 2.4
  5. asp.net mvc 动态显示不同的部分视图
  6. poj 1273 Drainage Ditches 最大流入门题
  7. Oracle用户及角色的权限管理[Oracle基础]
  8. hdu2007
  9. C++ 查找文件夹下的文件
  10. C++类对象大小的计算
  11. 老李分享:Web Services 组件 1
  12. c/c++ 多线程 一个线程等待某种事件发生
  13. (转!)Pyinstaller 打包发布经验总结
  14. 安装VisualSVN Server 报"Service 'VisualSVN Server' failed to start. Please check VisualSVN Server log in Event Viewer for more details"错误.原因是启动"VisualSVN Server"失败
  15. 粒子群算法(PSO)算法解析(简略版)
  16. SlickOne 敏捷开发框架介绍(二) -- 多用户/多租户/SAAS软件基础框架实现
  17. Packagist 镜像使用方法--composer
  18. luoguP2574 XOR的艺术
  19. stimulsoft report工具—— 简单的多表连接打印报表例子
  20. JMeter连接数据库(查询出的数据作为参数)

热门文章

  1. Usage of API documented as @since1.6+
  2. 转: 低延迟系统的Java实践
  3. 基于maven+dubbo+spring+zookeeper的简单项目搭建
  4. 二叉查找树BST----java实现
  5. centos网络配置实例
  6. Oracle中Hint深入理解(原创)
  7. 在EA中用ER图生成数据库
  8. Allegro skill
  9. php selenium 测试验证码问题
  10. 一步一步实现视频播放器client(二)