How does a CRichEditCtrl know a paste operation has been performed?

前端 未结 5 1413
说谎
说谎 2020-12-19 16:02

It has methods like CRichEditCtrl::Copy(), CRichEditCtrl::Paste() which you can call, but I can\'t spot any messages the control is sent by Windows

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-19 16:31

    Use the ON_MESSAGE Macro on your derived class.

    ON_MESSAGE(WM_PASTE, OnPaste)

    LRESULT CMyRichEditCtrl::OnPaste(WPARAM, LPARAM)

    If you open the RichEdit.h file, you will notice that some of the messages are on the range of WM_USER. Maybe this is how MFC handles the events for the Rich Edit Control.

提交回复
热议问题