win32的消息窗口使用 ---- 学习记录
2016-03-20 15:23
716 查看
/*
消息窗口的定义
int MessageBox(HWND hWnd,LPCTSTR lpText,LPCTSTR lpCaption,UINT uType);
hWnd 工作窗口句柄
lpText 在消息窗口中展示的信息
lpCaption 消息窗口中的标题
uType 定义各种图标及输入属性(影响消息窗口的显示及行为)
{影响显示的参数
MB_ICONQUESTION #询问信息提示图标
MB_ICONWARNING #警告信息提示图标
MB_ICONINFORMATION #信息提示图标
MB_ICONERROR #错误信息提示图片
影响行为的参数
MB_ABORTRETRYIGNORE Abort, Retry, and Ignore
MB_CANCELTRYCONTINUE Cancel, Try Again, and Continue
MB_HELP Help
MB_OK OK
MB_OKCANCEL OK and Cancel
MB_RETRYCANCEL Retry and Cancel
MB_YESNO Yes and No
MB_YESNOCANCEL Yes, No, and Cancel
行为结果参数
IDABORT Abort button was pressed
IDCANCEL Cancel button was pressed
IDCONTINUE Continue button was pressed
IDIGNORE Ignore button was pressed
IDNO No button was pressed
IDOK OK button was pressed
IDRETRY Retry button was pressed
IDTRYAGAIN Try Again button was pressed
IDYES Yes button was pressed
}
*/
int nResult = MessageBox (NULL,
_T("An example of Cancel,Retry,Continue" ),
_T("Hello Message Box!" ),
MB_ICONERROR | MB_ABORTRETRYIGNORE );
switch (nResult)
{
case IDABORT :
// 'Abort' was pressed
break;
case IDRETRY :
// 'Retry' was pressed
break;
case IDIGNORE :
// 'Ignore' was pressed
break;
}
消息窗口的定义
int MessageBox(HWND hWnd,LPCTSTR lpText,LPCTSTR lpCaption,UINT uType);
hWnd 工作窗口句柄
lpText 在消息窗口中展示的信息
lpCaption 消息窗口中的标题
uType 定义各种图标及输入属性(影响消息窗口的显示及行为)
{影响显示的参数
MB_ICONQUESTION #询问信息提示图标
MB_ICONWARNING #警告信息提示图标
MB_ICONINFORMATION #信息提示图标
MB_ICONERROR #错误信息提示图片
影响行为的参数
MB_ABORTRETRYIGNORE Abort, Retry, and Ignore
MB_CANCELTRYCONTINUE Cancel, Try Again, and Continue
MB_HELP Help
MB_OK OK
MB_OKCANCEL OK and Cancel
MB_RETRYCANCEL Retry and Cancel
MB_YESNO Yes and No
MB_YESNOCANCEL Yes, No, and Cancel
行为结果参数
IDABORT Abort button was pressed
IDCANCEL Cancel button was pressed
IDCONTINUE Continue button was pressed
IDIGNORE Ignore button was pressed
IDNO No button was pressed
IDOK OK button was pressed
IDRETRY Retry button was pressed
IDTRYAGAIN Try Again button was pressed
IDYES Yes button was pressed
}
*/
int nResult = MessageBox (NULL,
_T("An example of Cancel,Retry,Continue" ),
_T("Hello Message Box!" ),
MB_ICONERROR | MB_ABORTRETRYIGNORE );
switch (nResult)
{
case IDABORT :
// 'Abort' was pressed
break;
case IDRETRY :
// 'Retry' was pressed
break;
case IDIGNORE :
// 'Ignore' was pressed
break;
}
相关文章推荐
- EditText
- Awake OnEnable Start Update LateUpdate FixedUpdate
- ssh的工作原理之python获取远程主机公钥
- atom 打造轻量级C编辑 调试环境 使用clang
- Thinkphp模板怎么使用自定义函数
- 互联网产品各阶段的标准流程文档
- linux中如何快速在某目录下打开终端 及vim多文件调试
- Linux环境下FTP服务器的部署
- LeetCode--Substring with Concatenation of All Words(java)
- 写点什么呢?
- 构建之法阅读笔记03
- java集合框架——List
- 类的生命周期
- RecyclerView 的源码浅析
- javascript HashTable
- AC自动机
- 试着用java实现DNS(一)——DatagramSocket, DatagramPacket, Message
- iOS多线程比较、总结
- 我的第一个win32窗口程序------------记录
- String、StringBuffer、StringBuilder