🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.migration
Article #2

"PostMessage(HWND_BROADCAST, ...)" doesn�t work!

#2
From: Alexandre S�
Date: Fri, 17 Jun 2005 13:30
48 lines
2366 bytes
Hi there, I really need any help!

I�m migrating my Borland C++ project to C++ Builder 6.
It�s an old project, so on C++ Builder I created a Console Wizard project
and just one thing doen�s work fine...
...a "PostMessage(HWND_BROADCAST, ...)" method.

My new C++ Builder console application "doesn�t see" any HWND_BROADCAST
messages.
To be sure that this was the point, I made the following sample
application... but why it don�t receave HWND_BROADCAST messages?

The code of the sample application:

New -> Other -> Console Wizard -> (C++ Source Type, Don�t Use VCL, Multi
Threaded, Not Console Application)
//--------------------------------------------------------------------------
-
#include <windows.h>
#pragma hdrstop
//--------------------------------------------------------------------------
-
#define WM_MINE (WM_USER+238)
//--------------------------------------------------------------------------
-
#pragma argsused
WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR
lpCmdLine, int nCmdShow)
{
  PostMessage(HWND_BROADCAST, WM_MINE, 0, 0L);

  MSG msg;
  while(PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE)) {
    if (msg.message == WM_MINE) {
      // put a breakpoint here and see that it don�t receive the message
      int i=0;
      break;
    }
  }

  return 0;
}
//--------------------------------------------------------------------------
-

Any help?
Best Regards,
Alexandre S�
Technical Details
Message-ID: <42b2d086@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news1.google.com!newsread.com!newsprint.newsread.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 110f51,c7af685b6c955159,start
X-Google-Attributes: gid110f51,public
X-Google-Language: ENGLISH,ASCII
From: "Alexandre S�" <alexandre@daccord.com.br>
Newsgroups: borland.public.cppbuilder.migration
Subject: "PostMessage(HWND_BROADCAST, ...)"  doesn�t work!
Date: Fri, 17 Jun 2005 10:30:28 -0300
Lines: 50
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: 200.249.236.130
Message-ID: <42b2d086@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1119015046 200.249.236.130 (17 Jun 2005 06:30:46 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news1.google.com!newsread.com!newsprint.newsread.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail