我是靠谱客的博主 傻傻鼠标,最近开发中收集的这篇文章主要介绍MFC MessageBox 返回值判断,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

MessageBox will return zero if it fails, or one of:
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.

代码示例:

...
if(MessageBox(WindowHandleHere, MessageHere, TitleHere, StylesHere) == IDYES) // or IDNO, depending
{

// If the user clicks yes...

}

exp2:

if (IDYES == ::MessageBox(AfxGetMainWnd()->m_hWnd, "保存路径不存在,是否需要创建?","系统提示",MB_ICONEXCLAMATION|MB_YESNO ))
     {
      ……

     }

最后

以上就是傻傻鼠标为你收集整理的MFC MessageBox 返回值判断的全部内容,希望文章能够帮你解决MFC MessageBox 返回值判断所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(39)

评论列表共有 0 条评论

立即
投稿
返回
顶部