如何侦测每次输入的东西?不仅仅是键盘的输入,还有比如通过复制粘贴输入的东西,因为我要判断每次输入的东西是否合理,如果每次输入后对全部的内容进行判断有点多余,效率不好,我想是否可以增量的判断。记得以前似乎有过的,但是现在忘了。

解决方案 »

  1.   

    试试 EN_MSGFILTER 看看The EN_MSGFILTER message notifies a rich edit control's parent window of a keyboard or mouse event in the control. A rich edit control sends this notification message in the form of a WM_NOTIFY message.
      

  2.   

    在EN_CHANGE消息响应函数中判断
      

  3.   

    EN_CHANGE消息相应函数中不知道如何获取更新的内容阿。
      

  4.   

    BOOL CTest6Dlg::OnInitDialog()
    {
        m_richedit1.SetEventMask(m_richedit1.GetEventMask() | ENM_CHANGE);
    }void CTest6Dlg::OnChangeRichedit1() 
    {
    // TODO: If this is a RICHEDIT control, the control will not
    // send this notification unless you override the CDialog::OnInitDialog()
    // function and call CRichEditCtrl().SetEventMask()
    // with the ENM_CHANGE flag ORed into the mask.

    // TODO: Add your control notification handler code here
             
             //在这里判断

    }
      

  5.   

    void CTest6Dlg::OnChangeRichedit1()
    {
    // TODO: If this is a RICHEDIT control, the control will not
    // send this notification unless you override the CDialog::OnInitDialog()
    // function and call CRichEditCtrl().SetEventMask()
    // with the ENM_CHANGE flag ORed into the mask.// TODO: Add your control notification handler code here//在这里判断}
    在这个函数体中,如何获取更新的内容,而不是所有的内容呢?