CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2002
    Location
    United Kingdom
    Posts
    491

    Sending a message to all my applications.

    Hi,

    I am in the process of creating a set of applications which have numerous configuration settings. A seperate program has been made to manage these settings in an easy-to-use GUI.

    How can I add a button to the manager which will alert these programs that configurations have changed?

    All the message needs to include is the applications' name so that the target program can decide whether or not the message applies to it.

    Unfortunately the FindWindowEx API function is not an option because the target application window captions could change at any time without the manager being updated.

    Any help with this problem would be much appreciated!

    Best Regards,
    Lea Hayes

  2. #2
    Join Date
    Apr 2000
    Location
    Munich
    Posts
    212

    Re: Sending a message to all my applications.

    Check the SendMessage/PostMessage hWnd parameter in the MSDN:

    hWnd
    [in] Handle to the window whose window procedure will receive the message. If this parameter is HWND_BROADCAST, the message is sent to all top-level windows in the system, including disabled or invisible unowned windows, overlapped windows, and pop-up windows; but the message is not sent to child windows.
    ~christian

  3. #3
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917

    Re: Sending a message to all my applications.

    I would not advice broadcasting just any message (Windows or custom) since all windows that handle it may respond in non-predictable manner.
    Use a message registered with RegisterWindowMessage.
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

  4. #4
    Join Date
    Jan 2002
    Location
    United Kingdom
    Posts
    491

    Re: Sending a message to all my applications.

    Hi,

    Thankyou for your help it has worked great! I haved used the GUID generator with RegisterWindowsMessage API call which seems to have worked fine.

    Thanks again!
    Lea

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