笔记:MessageBox函数
来源:互联网 发布:mac 翻墙 免费 编辑:程序博客网 时间:2024/06/06 03:13
MessageBox函数,想必很多人都不会陌生!别看这个函数很简单,但是有一些功能,有人未必用过:P
请看下面的实例:
这个实例有什么特别的地方吗?自己编译运行一下就知道啦!
既然,提及到了这个函数,那就干脆写得完整一点吧!
1、MessageBox函数原型
它有4个参数,上面注释已经说明了各个参数的意义。下面,具体引述第4个参数的用法。
2、参数UINT uType
To indicate the buttons displayed in the message box, specify one of the following values.
Value
Meaning
MB_ABORTRETRYIGNORE
The message box contains three push buttons: Abort, Retry, and Ignore.
MB_CANCELTRYCONTINUE
Windows 2000/XP: The message box contains three push buttons: Cancel, Try Again, Continue. Use this message box type instead of MB_ABORTRETRYIGNORE.
MB_HELP
Windows 95/98/Me, Windows NT 4.0 and later: Adds a Help button to the message box. When the user clicks the Help button or presses F1, the system sends a WM_HELP message to the owner.
MB_OK
The message box contains one push button: OK. This is the default.
MB_OKCANCEL
The message box contains two push buttons: OK and Cancel.
MB_RETRYCANCEL
The message box contains two push buttons: Retry and Cancel.
MB_YESNO
The message box contains two push buttons: Yes and No.
MB_YESNOCANCEL
The message box contains three push buttons: Yes, No, and Cancel.
To display an icon in the message box, specify one of the following values.
Value
Meaning
MB_ICONEXCLAMATION,
MB_ICONWARNING
An exclamation-point icon appears in the message box.
MB_ICONINFORMATION, MB_ICONASTERISK
An icon consisting of a lowercase letter i in a circle appears in the message box.
MB_ICONQUESTION
A question-mark icon appears in the message box.
MB_ICONSTOP,
MB_ICONERROR,
MB_ICONHAND
A stop-sign icon appears in the message box.
To indicate the default button, specify one of the following values.Value
Meaning
MB_DEFBUTTON1
The first button is the default button.
MB_DEFBUTTON1 is the default unless MB_DEFBUTTON2, MB_DEFBUTTON3, or MB_DEFBUTTON4 is specified.
MB_DEFBUTTON2
The second button is the default button.
MB_DEFBUTTON3
The third button is the default button.
MB_DEFBUTTON4
The fourth button is the default button.
3、函数返回值
If the function succeeds, the return value is one of the following menu-item values.
Value
Meaning
IDABORT
Abort button was selected.
IDCANCEL
Cancel button was selected.
IDCONTINUE
Continue button was selected.
IDIGNORE
Ignore button was selected.
IDNO
No button was selected.
IDOK
OK button was selected.
IDRETRY
Retry button was selected.
IDTRYAGAIN
Try Again button was selected.
IDYES
Yes button was selected.
后记:一些常用的东西反而容易忘记!为了避免每次都得查MSDN,故整理如此,供日后参考。偷懒了,直接贴MSDN的资料上来:P
- 笔记:MessageBox函数
- messagebox函数
- MessageBox函数
- MessageBox函数
- MessageBox() 函数
- messagebox函数
- MessageBox函数
- Messagebox函数
- MessageBox()函数
- MessageBox函数
- MessageBox 函数
- (4)MessageBox函数
- windows函数 MessageBox
- MESSAGEBOX 函数用法解析
- MessageBox.Show()函数小解
- (4)MessageBox函数
- MessageBox()API函数
- Windows编程MessageBox函数
- 资料收集[-] Winsock|NDIS
- Android Activity和Intent机制
- C/C++中文件的读写格式
- 天气预报抓取的方法和源代码(包括从IP获取)
- C#的闪屏的制作
- 笔记:MessageBox函数
- Xmanager3.0注册码
- 禁电动车的连锁反应
- 磨刀不误砍柴工:Ext4核心组件Grid的变化及学习(3):可编辑的grid
- 准备开始博客了
- 分布式文件系统关键点
- 栈—迷宫求解(求解所有可通过路径)
- 每日设计模式——迭代器模式
- 电话面试流程