windows应用开发由浅入深(一)MessageBox消息框
来源:互联网 发布:百度网盘vip淘宝 编辑:程序博客网 时间:2024/04/30 14:13
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,说明消息框操作成功。具体返回值含义如下:
(用户点击了取消按钮、或者标题栏关闭按钮、或按下ESC键)IDIGNOREIgnore button was selected.(用户点击了忽略按钮)IDNONo button was selected.(用户点击了否按钮)IDOKOK button was selected.(用户点击了是按钮)IDRETRYRetry button was selected.(用户点击了重试按钮)IDYESYes button was selected.(用户点击了确定按钮)
0 0
- windows应用开发由浅入深(一)MessageBox消息框
- windows应用开发由浅入深(一)AfxMessageBox消息框
- windows应用开发由浅入深(四)创建热键消息
- windows应用开发由浅入深(二)有关控件的操作
- windows应用开发由浅入深(三)有关不规则窗口
- 《windows程序设计》(一)-------MessageBox
- C++ Windows应用程序 弹出消息框MessageBox
- [windows程序设计]-消息弹框,messagebox---ShinePans
- windows应用开发由浅入深(二)常用控件--滑块、标签、树形控件、列表控件
- windows应用开发由浅入深(二)常用控件--进度条、滚动条
- windows 8 metro MessageBox消息框的消失
- MessageBox 消息框
- Ext.MessageBox消息框
- 消息框MessageBox
- wpf MessageBox 消息框
- Ext.MessageBox消息框
- windows应用开发由浅入深(三)有关鼠标事件--设置鼠标点击测试值实现非标题栏拖动窗口
- windows应用开发由浅入深(三)利用注册表将程序启动时窗口位置设置为上次关闭的位置
- Zend Framework中遇到的问题和解决方法
- 在不同的环境中编译hello world程序
- Convnet在Windows下的使用
- 关于html5 css3的细节问题
- Bloom Filter的概念和原理
- windows应用开发由浅入深(一)MessageBox消息框
- win7 打开 chm 空白
- 知识问答-线程
- 在一个矩形框中输出一条问候语
- html5 css3基础知识
- Linux中的nice程序名字的由来
- 回调函数学习笔记
- android开发 单线程模型和多线程实现
- OpenGL: 透明