怎么实现在edit里,只能输入,而不能删除!,就是对backspace和del无效。
还有,要想在edit这个控件里加wm_char 消息怎么加?因为好像只有在对话框窗口才能加这个消息响应。

解决方案 »

  1.   

    你判断edit的句柄。然后响应wm_char消息不就行了吗
      

  2.   

    添加对话框的虚函数 virtual BOOL PreTranslateMessage(MSG* pMsg);函数里写:
    BOOL CDddDlg::PreTranslateMessage(MSG* pMsg) 
    {
    // TODO: Add your specialized code here and/or call the base class
    if   (pMsg->message   ==   WM_KEYDOWN)   
    {   
    if   (pMsg->wParam==VK_DELETE||pMsg->wParam==VK_BACK)   
    return   TRUE;     //TRUE   :截获消息,到此为止。   
    }   
    return   CDialog::PreTranslateMessage(pMsg);   
    }
      

  3.   

    从CEdit派生类,然后处理你要屏蔽的消息。。