Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to : detect pasting text to a rich edit control ?

Status
Not open for further replies.

dima2

Programmer
Jan 20, 2002
85
0
0
LB
hi
is there a way to get a notification when the user pastes text to a rich edit control ?

thx
 
Hi

Suppose you add a CRichEditCtrl to a Dialogbox and you use the class wizard to name the instane m_RichEdit.

In the override of OnInitDialog, add the following line:

m_RichEdit.SetEventMask( ENM_CHANGE);

Now add the handler for the message EN_CHANGE with the class wizard.

That's it ...

Don't forget to add the function AfxInitRichEdit() in the InitInstance function

HTH

Thierry
EMail: Thierry.Marneffe@swing.be
 
but this will also give me notification everytime a user types something. I only need to handle pasting
 
another suggestion :)
subclass the control and write handlers for WM_PASTE and EM_PASTESPECIAL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top