Article View: borland.public.cppbuilder.nativeapi
Article #6013Re: HWND_BROADCAST doesn�t work!
From: Bob Gonder
Date: Fri, 17 Jun 2005 22:44
Date: Fri, 17 Jun 2005 22:44
27 lines
2251 bytes
2251 bytes
Remy Lebeau (TeamB) wrote: >"Alexandre S�" <alexandre@daccord.com.br> wrote in message > >The only way that would happen is if your code is not setting up a top-level >window that is capable of receiving broadcasts in the first place. Your >other uses of PostMessage() send the message to a specific window or a >specific thread (PostMessage(NULL, ...) is the same as calling >PostThreadMessage(GetCurrentThreadId(), ...)) without any broadcasting, >which explains why the peeking works fine for them. > >> static LRESULT WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) > >That is not the proper signature for a window procedure. You left out the >calling convention. Further, by taking a working program, and replacing this PostMessage(hWnd,WM_COMMAND,CM_U_START,0); with this PostMessage(HWND_BROADCAST, WM_COMMAND, CM_U_START,0); It continued to process the start command, so the function does work. You are not getting a window that is capable of receiving HWND_BROADCAST Further, Check You Return Codes! Register() fails!
Technical Details
Message-ID:
<cjj6b1hc3t1tjnju46lto298h1h7k3bjvg@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshosting.com!nx02.iad01.newshosting.com!news-peer0-test!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<42b30d0a$1@newsgroups.borland.com> <42b317d0$1@newsgroups.borland.com> <42b31b9a@newsgroups.borland.com> <42b3322d$1@newsgroups.borland.com> <42b34cfc$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,af4f253f03c4e6fb X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: HWND_BROADCAST doesn�t work! Date: Fri, 17 Jun 2005 15:44:00 -0700 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <cjj6b1hc3t1tjnju46lto298h1h7k3bjvg@4ax.com> References: <42b30d0a$1@newsgroups.borland.com> <42b317d0$1@newsgroups.borland.com> <42b31b9a@newsgroups.borland.com> <42b3322d$1@newsgroups.borland.com> <42b34cfc$1@newsgroups.borland.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit NNTP-Posting-Host: 69.69.91.235 X-Trace: newsgroups.borland.com 1119048238 69.69.91.235 (17 Jun 2005 15:43:58 -0700) Lines: 30 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshosting.com!nx02.iad01.newshosting.com!news-peer0-test!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail