Article View: borland.public.cppbuilder.nativeapi
Article #105Re: PostThreadMessage() vs. PostMessage(HWND_BROADCAST, ...)
From: Remy Lebeau (TeamB)
Date: Fri, 27 Jun 2008 05:33
Date: Fri, 27 Jun 2008 05:33
24 lines
1720 bytes
1720 bytes
"salamander1965" <salamander1@verizon.net> wrote in message news:48641223@newsgroups.borland.com... > Should a message queue that receives a message from PostThreadMessage() > also receive one from PostMessage() with HWND_BROADCAST as > the first parameter (assuming the queue belongs to a primary thread of a > process)? Only if the thread hosts a top-level window. Otherwise, no. > The message loop never sees the registered message, though. Because it has no window to receive broadcasts with. > The problem is I cannot guarantee that the main app will always have the > threadID it needs to send the message, so broadcasting using PostMessage() > would be preferable. Then you have to give the background app a window. You can't receive broadcasts without one. Gambit
Technical Details
Message-ID:
<48647d7d$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!eweka.nl!lightspeed.eweka.nl!feeder.erje.net!news.isoc.lu!newsgroups.borland.com!not-for-mailReferences:
<48641223@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,131f98b50b72aa44 X-Google-Attributes: gid10cc67,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <48641223@newsgroups.borland.com> Subject: Re: PostThreadMessage() vs. PostMessage(HWND_BROADCAST, ...) Date: Thu, 26 Jun 2008 22:33:45 -0700 Lines: 26 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 NNTP-Posting-Host: 76.94.74.164 Message-ID: <48647d7d$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1214545277 76.94.74.164 (26 Jun 2008 22:41:17 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!eweka.nl!lightspeed.eweka.nl!feeder.erje.net!news.isoc.lu!newsgroups.borland.com!not-for-mail