title: Can a CRichEditCtrl know when someone sets its text?
body: <p>When typing into a CRichEditCtrl, EN_CHANGE messages are generated. However <a href="http://msdn.microsoft.com/en-us/library/bb761676(VS.85).aspx" rel="nofollow noreferrer">MSDN</a> says:</p>
  <blockquote>
  <p>Rich Edit: Supported in Microsoft Rich
  Edit 1.0 and later. To receive
  EN_CHANGE notifications, specify
  ENM_CHANGE in the mask sent with the
  EM_SETEVENTMASK message. For
  information about the compatibility of
  rich edit versions with the various
  system versions, see About Rich Edit
  Controls.</p>
  <p><strong>The EN_CHANGE notification is not sent
  when the ES_MULTILINE style is used
  and the text is sent through
  WM_SETTEXT</strong>.</p>
  </blockquote>
  <p>I have several dialogs using a multi-line rich edit control, actually my custom <code>CMyRichEdit</code> class. That class automatically performs analysis when the text changes, but in the important case where the dialog is initially populated, no notification is seen.</p>
  <p>The point is to avoid having to change our code-base more than absolutely necessary - the new control is being dropped in to replace existing ones. Chasing down every instance where <code>getDlgItem(IDC_EDIT)-&gt;SetWindowText</code> is used, or where <code>DDX_Text(pDX, IDC_EDIT, m_strEdit)</code> automatically links a string contents with the control, would mean a lot of trawling through code and re-testing everything altered.</p>
  <p>Is there an easy way? Can <code>MyRichEdit</code> catch its own <code>WM_SETTEXT</code> messages?</p>