我用了一个命令,如果IDCANCEL就弹出个框框,结果没得反应呢?

解决方案 »

  1.   

    不是,他只会触发wm_close消息
      

  2.   

    如果你重载了OnCancel虚函数就会看到,在这点上,它跟IDCANCEL功能是一样的
      

  3.   

    重载OnCancel函数,按下X或者ESC的时候会调用这个函数
    CMyDialog::OnCancel()
    {
      //do something  //如果调用CDialog::OnCancel()表明这个操作有效,对话框会消失或隐藏
      //不调用的时候,比如你不想回车或者ESC起作用
    }
      

  4.   

    不是,系统对话框的取消按钮时IDCANCEL.
      

  5.   

    还有没有别的办法啊?因为一个属性页啊。PAGE是我做的,但SHEET是自己生成的啊。
    上面没有按钮,只有一个X,以前生成的都有按钮。
      

  6.   

    5555555....
    以前我都是这样的。
    int Result=Sheet.DoModal();
    if(Result=IDCANCEL)
    {
    .....
    }
    现在没办法了,重载啊?可是这个Sheet都没有文件啊,是自动生成的啊,我重载到哪儿啊不知道是我太笨,还是怎么样,如果没有办法,只有在上面加按钮了。可是,怎么加?
      

  7.   

    你想处理X按钮,就重载OnSysCommand函数。CWnd::OnSysCommand
    This method is called by the framework when the user selects a command from the Control menu, or when the user selects the Maximize or the Minimize button. afx_msg void OnSysCommand( 
    UINT nID, 
    LPARAM lParam ); 
    Parameters
    nID 
    Specifies the type of system command requested. This parameter can be any one of the following values: 
    SC_CLOSE   Close the CWnd object. 
      

  8.   

    那sdk下呢,应该怎么办呢?谢谢各位,不要觉得我烦哦~~