🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: IPC, using Application->OnMessage

#1140
From: Bob Gonder
Date: Sun, 28 Oct 2007 17:26
24 lines
1739 bytes
Marc wrote:

>I try to implement IPC between my two processes.

>I use HWND_BROADCAST because in future the sender and receiver will be in 
>two separate processes.

If in the future they will be on different computers, this won't work.

>If I run the application like this and press the button, I receive one 
>OutputDebugString. This is what I expected.
>
>But when I create a second form, and place a TTimer component on it, I 
>receive the OutputDebugString twice.

Every top-level window (form) gets the message.

>Is not the "Handled=true" statement supposed to prevent the message from 
>being sent to another Window ?

No.
It is a BROADCAST just like radio or TV.
Your watching it doesn't stop others from viewing it too.
Every running (windowed) application on your machine will get your spam.
Technical Details
Message-ID: <9ig9i3hr3qf15n249d5dllfuf2a46upfs8@4ax.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4724b19d$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,4f22b81ff465f675
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: IPC, using Application->OnMessage
Date: Sun, 28 Oct 2007 10:26:55 -0700
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <9ig9i3hr3qf15n249d5dllfuf2a46upfs8@4ax.com>
References: <4724b19d$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 69.69.84.21
X-Trace: newsgroups.borland.com 1193592414 69.69.84.21 (28 Oct 2007 10:26:54 -0700)
Lines: 26
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail