CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2001
    Location
    germany
    Posts
    772

    PostMessage to child

    Hi,

    I am having a dialog-based application containing a property sheet. each tab corresponds to a dialog class implementing some controls. on one of the tabs, there is a button calling a third dialog (modal).
    Now, I have a recursive function which is supposed to show something in the third dialog. So, I have to pass some data from the original dialog class (of the project) to the third dialog. But the message handling function in the third dialog is never called.
    I tried to use
    GetForegroundWindow()->PostMessage(MYMESSAGE, 0,0);
    and:
    ::PostMessage(GetActiveWindow()->m_hWnd,MYMESSAGE,0,0);
    but it doesn't work.

    Any other idea?
    Thanks in advance

    radu
    Please rate if it helps!

    * The second mouse gets the cheese.

    * Birthdays are good for you. The more you have, the longer you live.

    * Always keep your words soft and sweet, just in case you have to eat them.

    * Always read stuff that will make you look good if you die in the middle of it.

  2. #2
    Join Date
    Aug 2001
    Location
    germany
    Posts
    772

    Re: PostMessage to child

    well the problem was that the dialog wasn't yet created. Still it wouldn't work with a modal dialog because the PostMessage code in the main dialog would never be executed.
    Please rate if it helps!

    * The second mouse gets the cheese.

    * Birthdays are good for you. The more you have, the longer you live.

    * Always keep your words soft and sweet, just in case you have to eat them.

    * Always read stuff that will make you look good if you die in the middle of it.

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