: I have read some solutions that said you should subclass a control in order
: to do certain things such as intercept messages. What I was wondering was
: how to you do this.
: For example I was told in order to stop a text box from highlighting the
: text when it receives focus I should subclass it and intercept the
: selection message. What is the syntax to subclass this text box, and how do
: I intercept the messages sent to it?
: Please be detailed and technical with the answer, I'm up to it.
It's quite simple. If you have a control, i.e. an edit control,
then create a class derived from a CEdit (if using MFC). Then map
a handler for the message you want to intercept.
Now, here is how you subclass the control. Let's say you have a
control with id IDC_EDIT1. Then do this:
CMyEditClass m_edit1; // declared somewhere.
m_edit1.SubclassDlgItem(IDC_EDIT1, this); // this = parent window.
I told you it was trivial :).
: Thank you very much,
Good luck,
--
Donald
**************************************************************
* I got a Mantis in my Pantis. *
* Professor, pathology is limited, it's pathetic! *
* -- Mystery Science Theater 3000 *
**************************************************************
*Samples:ftp://ftp.hpc.uh.edu/pub/donald *
**************************************************************