🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #12470

How to use Msg given by RegisterWindowMessage ?

#12470
From: Marc Gerin
Date: Mon, 08 Dec 2003 13:38
26 lines
1499 bytes
Hello everybody!
I want to trigger an action in one application by
a message sent from an other application.
First application i tried this:

TForm1 *Form1;
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
Mes=RegisterWindowMessage("essai");  }
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
PostMessage(HWND_BROADCAST,Mes,1,1);
}

Other application:
I think one choice is a loop:
    MSG msg;
while (GetMessage((LPMSG)&msg,...)){
if(msg.message=RegisterWindowMessage("essai"))
{...}
}
I didn't tried it but if it work, is there any other choice which
don't lock the second application in the loop?

Best regards
Technical Details
Message-ID: <3fd47dad$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,eb1e7462132dca51,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-12-08 05:39:40 PST
From: "Marc Gerin" <germar@skynet.be>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: How to use Msg given by RegisterWindowMessage ?
Date: Mon, 8 Dec 2003 14:38:23 +0100
Lines: 28
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 80.200.238.235
Message-ID: <3fd47dad$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1070890413 80.200.238.235 (8 Dec 2003 05:33:33 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail