怎么让CEdit控件内不能粘贴?,就是不能从别处拷贝东西粘贴到cedit内

解决方案 »

  1.   

    拦截消息.或者重载相关函数
    WM_COPY Message--------------------------------------------------------------------------------An application sends the WM_COPY message to an edit control or combo box to copy the current selection to the clipboard in CF_TEXT format. Syntax
    To send this message, call the SendMessage function as follows. 
    lResult = SendMessage(      // returns LRESULT in lResult     (HWND) hWndControl,      // handle to destination control     (UINT) WM_COPY,      // message ID     (WPARAM) wParam,      // = (WPARAM) () wParam;    (LPARAM) lParam      // = (LPARAM) () lParam; );   
    ParameterswParam
    Not used; must be zero. 
    lParam
    Not used; must be zero. 
    Return ValueThis message does not return a value. 
      

  2.   


    void XXX::OnContextMenu(CWnd* /*pWnd*/, CPoint /*point*/)
    {
    //什么都不用写
    }