BOOL CCXXX::PreTranslateMessage(MSG* pMsg) 
{
    if(pMsg->message == WM_KEYDOWN)
    {
        switch(pMsg->wParam)
        {
        case VK_RETURN://屏蔽回车
            return TRUE;
        case VK_ESCAPE://屏蔽Esc
            return TRUE;
        }
    }
    return CDialog::PreTranslateMessage(pMsg);

解决方案 »

  1.   

    BOOL CFamilyDlg::PreTranslateMessage(MSG* pMsg) 
    {
    // TODO: Add your specialized code here and/or call the base class
    //**Disable the esc key and enter key
    if(pMsg->message==WM_KEYDOWN)
    if(pMsg->wParam==VK_ESCAPE || pMsg->wParam==VK_RETURN)
    return FALSE; return CDialog::PreTranslateMessage(pMsg);
    }
      

  2.   

    BOOL CFamilyDlg::PreTranslateMessage(MSG* pMsg) 
    {
    // TODO: Add your specialized code here and/or call the base class
    //**Disable the esc key and enter key
    if(pMsg->message==WM_KEYDOWN)
    if(pMsg->wParam==VK_ESCAPE || pMsg->wParam==VK_RETURN)
    return FALSE; return CDialog::PreTranslateMessage(pMsg);
    }
      

  3.   

    重载OnOk函数,函数直接返回就行了,或者直接加入你自己的处理过程
      

  4.   

    http://www.vckbase.com/bbs/prime/search.asp?r=300&s=1
      

  5.   

    只要不让它调用缺省的函数OnOk()就可以了。
      

  6.   

    改变让默认的“确定”按钮的ID让他不是IDOK就可以了。
    或者把改他的属性,去掉和回车相关的那个钩。
      

  7.   

    重载OnOK() 并且不要在其中调用基类的OnOK() 函数