Roy
The simple answer is to derive a class from CEdit using ClassWizard, add a handler for the
WM_LBUTTONDBLCLK message, and then use this class to represent your edit box in the dialog. I don't
know what it is you want to do in your handler, so if you usurp it outright it may or may not be
contradictory to the normal operation of the edit control which, "...Clears the current selection
and selects the word under the cursor. If the SHIFT key is depressed, extends the selection to the
word under the cursor.", in response to the WM_LBUTTONDBLCLK message. This may be what you want, or
if all you need is the notification, then continue passing the event on to the original
CEdit::OnLButtonDblClk handler.
Jeff...
--
Please post all follow-ups to the newsgroup only.
Roy Whitehead wrote in message <8mmqir$2cap$1...@news5.isdnet.net>...
Thanks Roy
Jeff Partch <airb...@airmail.net> a écrit dans le message :
OJx8QjLAAHA.79@cppssbbsa05...
Roy Whitehead wrote in message <8mo91h$9d0$1...@news4.isdnet.net>...
>Jeff,
> The other problem ( If a can call it a problem is that any controls
>using your method must therefore be created dynamically at run time- correct
>me if I am wrong ).
>
> Thanks Roy
>
Roy!
No, just use a member variable of your derived class as the member variable in your CDialog class.
If you create the derived class (using ClassWizard I think) before using using CW to add the member
variable, then your derived class should be available in the "variable type" combobox along with the
usual CEdit. If you have it already set up to use a CEdit, the just go to the header for your
CDialog derived class and change the "CEdit m_edit" line to "CMyEdit m_edit". The dialog control is
still a window's EDIT control and created just like any dialog control. It is usually subclassed by
MFC using a standard CEdit class which gets a chance at the messages before the HWND it represents,
but by using your own derived CEdit class, you get first crack at the messages. Usually in a dialog,
it's all about subclassing (this is what the DDX_Control function does) existing controls and not
creating (although you can do that too) them.
Jeff...
Cheers Roy