请您用以上函数显示一个Yes/no的选择对话框(同时最好有个问号出现)
接下去根据选择,分别执行不同的代码。类似:if (IDOK==dlg.DoModal()) {}
else {}
可是用MessageBox这样写,我不会。
请指教,多谢!
接下去根据选择,分别执行不同的代码。类似:if (IDOK==dlg.DoModal()) {}
else {}
可是用MessageBox这样写,我不会。
请指教,多谢!
解决方案 »
- WinInet编程 HTTP协议 post数据到htm(或其他类型文件)中,htm或(其他文件类型)该怎么写我才能接受我发送的数据
- 大家知道有什么比较好的学习windows SDK编程的论坛吗?
- 子线程调用主线程创建的com对象,程序没反应了
- 求助:base class undefined
- 如何以缩略图查看方式打开目录
- 发送结构体问题
- vc中对数据库操作时,如何分辨捕获的异常是超时的异常。
- com和dll,有什么区别?
- 仁兄没,快来强分哦,一个关于动态连接库的傻瓜问题
- 不好解决的问题,在此过程中无论谁都将获益非浅!
- 怎样才能在往ListView里面添加元素的时候,让ListView自动向下滚动,多谢了
- 这就是VC++ 6 啊???
{
//你按了YES
}
else
{
//你按了No
}AfxMessageBox("How do you do?","Hello",MB_YESNO | MB_ICONQUESTION )
{}
else
{}
HWND hWnd, // handle to owner window
LPCTSTR lpText, // text in message box
LPCTSTR lpCaption, // message box title
UINT uType // message box style
);
Parameters
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.
lpText
[in] Pointer to a null-terminated string that contains the message to be displayed.
lpCaption
[in] Pointer to a null-terminated string that contains the dialog box title. If this parameter is NULL, the default title Error is used.
uType
[in] Specifies the contents and behavior of the dialog box. This parameter can be a combination of flags from the following groups of flags.
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- 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.
{
}
else
{
}
MessageBox用法同理。(只不过还多一个标题参数)
通过它们的返回值来判断