Click to See Complete Forum and Search --> : How to use WM_NOTIFY message


xxxac
August 4th, 1999, 09:20 PM
After I change the text of an edit control, I want to notify the parent of the edit control that the content
has been changed, how can I do that? use the WM_NOTIFY messeage.

Thank!

zva
August 4th, 1999, 10:47 PM
You can override EN_CHANGE. This event is send to the control's parent when the edit control's value is changed.
Add ON_EN_CHANGE(<id of edit control>, <member function()>) on your message map.

BEGIN_MESSAGE_MAP()
.
.
ON_EN_CHANGE(ID_EDITCONTROL, OnEditControlChange())
.
END_MESSAGE_MAP()

void WindowDerivedFromCWnd::OnEditControlChange()
{
//do your stuff here...
}

and don't forget to declare the function on your header file.

I hope this helps.

xxxac
August 6th, 1999, 02:31 PM
I only have an executable application file in which contain that edit control. Now I can change the content of that control, I want to the application know the change so that it can take corresponding action. Can WM_NOTIFY do that?

Anyway, thanks!

Yogesh Sontakke
August 9th, 1999, 06:12 AM
Hi,

Why not just use SendMessage(....) to the parent window/app when the edit box receives a Change message!!

If not, u can read up on some stuff on Message Reflection in MSDN...'am sure there are quite some ways to notify a parent...

HTH
Yogesh