概述
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 返回值判断所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复