呵呵,以前用惯PB,VC中如何实现?
望各位高手不要嫌弃问题简单啊,跪求。。

解决方案 »

  1.   


    if (AfxMessageBox("quit?", MB_OKCANCEL) == IDOK)
    CDialog::OnCancel();
      

  2.   

    long isExit;
    isExit=MessageBox("你确定要退出?","确定",MB_OKCANCEL|MB_ICONQUESTION|MB_DEFBUTTON2);

    if (isExit==1)
    {
        CDialog::OnCancel();
    }
      

  3.   

    void CMainFrame::OnClose() 
    {
    int i=-1;
        i=AfxMessageBox("真的想退出吗",MB_OKCANCEL);
    if(i==1)
    {
    CFrameWnd::OnClose();
    }}
      

  4.   

    if (AfxMessageBox("您真的退出系统吗",MB_YESNO | MB_ICONQUESTION )==IDYES)
    {
    m_bQuit = TRUE;
    SendMessage(WM_CLOSE,0,0);
    }
      

  5.   

    if (AfxMessageBox("您真的退出系统吗",MB_YESNO | MB_ICONQUESTION )==IDYES)
    {
    m_bQuit = TRUE;
    PostMessage(WM_CLOSE,0,0);
    }呵呵~~
      

  6.   

    好用。
    if (AfxMessageBox("您真的退出系统吗",MB_YESNO | MB_ICONQUESTION )==IDYES)
    {
    m_bQuit = TRUE;
    PostMessage(WM_CLOSE,0,0);
    }真的好用
      

  7.   

    int val=AfxMessageBox("quit?", MB_OKCANCEL|MB_ICONQUESTION|MB_APPLMODAL);
    if(val==IDOK)
    {
    exit(0);
    }
      

  8.   

    http://community.csdn.net/Expert/topic/3201/3201961.xml?temp=.184231
      

  9.   

    if (AfxMessageBox("您真的退出系统吗",MB_YESNO | MB_ICONQUESTION )==IDYES)
    {
    m_bQuit = TRUE;
    SendMessage(WM_CLOSE,0,0);
    }
    最好了
      

  10.   

    void CMainFrame::OnClose() 
    {
    // TODO: Add your message handler code here and/or call default
    //
    int i=-1;
        i=AfxMessageBox("真的想退出吗",MB_OKCANCEL);
    if(i==1)
    {
    CFrameWnd::OnClose();
    }}
    OnClose() 响应WM_CLOSE