subclassing RichEditCtrl and EN_SELCHANGE
- From: "Mariusz Popiołek" <mpopiolek@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 25 Apr 2005 15:39:10 +0200
Hi
I'm subclassing RichEditCtrl and I have to write custom EN_SELCHANGE handler
in my class (CValidatingEdit). The problem is that class wizard doesn't show
EN_SELCHANGE in messages list. I tried using OnNotify/OnChildNotify but it
doesn't help.
void CValidatingEdit::PreSubclassWindow()
{
SetEventMask(GetEventMask() | ENM_CHANGE | ENM_SELCHANGE);
CRichEditCtrl::PreSubclassWindow();
}
BOOL CValidatingEdit::OnChildNotify(UINT message, WPARAM wParam, LPARAM
lParam, LRESULT* pLResult)
{
if (message == EN_SELCHANGE)
MessageBox("EN_SELCHANGE");
return CRichEditCtrl::OnChildNotify(message, wParam, lParam, pLResult);
}
BOOL CValidatingEdit::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT*
pResult)
{
NMHDR *pNMHDR = (NMHDR*)lParam;
if (pNMHDR->code == EN_SELCHANGE)
MessageBox("EN_SELCHANGE");
return CRichEditCtrl::OnNotify(wParam, lParam, pResult);
}
Of course I can handle this event in the dialog (I mean handling this event
in dialog for control instance), but of course I want to put whole code in
my custom class. Thanks in advance for any help.
Marian
.
- Follow-Ups:
- Prev by Date: Re: timer
- Next by Date: Re: subclassing RichEditCtrl and EN_SELCHANGE
- Previous by thread: Re-exporting functions from dynamically linked DLL
- Next by thread: Re: subclassing RichEditCtrl and EN_SELCHANGE
- Index(es):
Relevant Pages
|