大虾们:请问在使用AfxMessageBox()时,如何设置提示框的标题,还有,该提示框的肯定、否定及
取消的编程接口在什么地方?不胜感谢!

解决方案 »

  1.   

    MessageBox("你的字符", "这里是标题", MB_YESNOCANCEL);
    AfxMessageBox("你的字符.",MB_YESNOCANCEL,0);
      

  2.   

    AfxMessageBox("被显示的信息.",MB_YESNOCANCEL|MB_ICONINFORMATION,0);
      

  3.   

    AfxMessageBox()不能设置标题,如果要设置标题就用MessageBox()好了
      

  4.   

    see MSDN
    AfxMessageBox 
    int AfxMessageBox( LPCTSTR lpszText, UINT nType = MB_OK, UINT nIDHelp = 0 );int AFXAPI AfxMessageBox( UINT nIDPrompt, UINT nType = MB_OK, UINT nIDHelp = (UINT) -1 );Return ValueZero if there is not enough memory to display the message box; otherwise one of the following values is returned: IDABORT   The Abort button was selected.
    IDCANCEL   The Cancel button was selected.
    IDIGNORE   The Ignore button was selected.
    IDNO   The No button was selected.
    IDOK   The OK button was selected.
    IDRETRY   The Retry button was selected.
    IDYES   The Yes button was selected. 
    If a message box has a Cancel button, the IDCANCEL value will be returned if either the ESC key is pressed or the Cancel button is selected. If the message box has no Cancel button, pressing the ESC key has no effect.The functions AfxFormatString1 and AfxFormatString2 can be useful in formatting text that appears in a message box.ParameterslpszTextPoints to a CString object or null-terminated string containing the message to be displayed in the message box.nTypeThe style of the message box. Apply any of the message-box styles to the box.  nIDHelpThe Help-context ID for the message; 0 indicates the application’s default Help context will be used.nIDPromptA unique ID used to reference a string in the string table.ResDisplays a message box on the screen. The first form of this overloaded function displays a text string pointed to by lpszText in the message box and uses nIDHelp to describe a Help context. The Help context is used to jump to an associated Help topic when the user presses the Help key (typically F1).The second form of the function uses the string resource with the ID nIDPrompt to display a message in the message box. The associated Help page is found through the value of nIDHelp. If the default value of nIDHelp is used (– 1), the string resource ID, nIDPrompt, is used for the Help context. For more information about defining Help contexts, see the articleHelp Topics in Visual C++ Programmer’s Guide and Technical Note 28.  See Also   CWnd::MessageBox