----- Original Message -----
From: "Neven MacEwan" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Tuesday, March 18, 2003 10:28 PM
Subject: [DUG]: PostMessage
> Hi all
>
> In my app I have a whole lot of forms which are embedded in a page control
> of the 'Main Form'
> If one one these forms wants to notify all other forms in the app of a
> change, what is the best way to do it?
>
> Iv'e tried
>
> PostMessage(HWND_BROADCAST, WM_APPDATACHANGE, 0, 0);
>
> but none of the other forms seem to get this message, is this because I
> really only have 1 form in my app?
>From the Platform SDK:
"HWND_BROADCAST - The message is posted to all top-level windows in the
system, including disabled or invisible unowned windows, overlapped windows,
and pop-up windows. The message is not posted to child windows."
I would assume that your windows, embedded as they are, do not qualify as
'top-level' windows. I'm a little hazy about exactly which windows DO
qualify, but I assume they're all those that have a null parent. However,
since the message gets sent to ALL top-level windows, not just those in your
application, it's likely to be of little use to you.
You might want to consider writing a method or message handler for the main
form that forwards the message on to each of the embedded windows. There
are probably other ways to handle it, but it depends on your implementation
I guess. Message forwarding via the main form is the simplest method I can
think of.
--
Corey Murtagh
The Electric Monk
"Quidquid latine dictum sit, altum viditur!"
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/