CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 1999
    Posts
    6

    How to use WM_NOTIFY message

    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!


  2. #2
    Join Date
    Jun 1999
    Posts
    8

    Re: How to use WM_NOTIFY message

    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()&gt 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.



  3. #3
    Join Date
    Jul 1999
    Posts
    6

    Re: How to use WM_NOTIFY message

    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!



  4. #4
    Join Date
    May 1999
    Posts
    11

    Re: How to use WM_NOTIFY message

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured