🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Sending and receiving custom messages between applications (code included)

#6981
From: Scott Morris
Date: Wed, 30 Mar 2005 16:15
27 lines
2114 bytes
> Is there a "trick" to make it faster OR better way to send/receive
messages
> among multiple applications?

Directly from the MSDN documentation.

"The SendMessage function sends the specified message to a window or
windows. It calls the window procedure for the specified window and does not
return until the window procedure has processed the message.

To send a message and return immediately, use the SendMessageCallback or
SendNotifyMessage function. To post a message to a thread's message queue
and return immediately, use the PostMessage or PostThreadMessage function."

Options.
1 - do not not wait for a response.
2 - do not send the message to applications that have no interest (which is
likely to be most of the running applications since they know nothing about
your custom message).
3 - use a different IPC mechanism.

Without specifics about what you are trying to accomplish, I can't really
offer alternatives.  Broadcasting a message to every application and waiting
for a response is probably the slowest form of IPC (but very easy and very
powerful).  Perhaps the following link will be useful.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipc/base/interprocess_communications.asp?frame=true
Technical Details
Message-ID: <424ad08d$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <424ab04c$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,775f7f4787da1067
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Scott Morris" <bogus@bogus.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <424ab04c$1@newsgroups.borland.com>
Subject: Re: Sending and receiving custom messages between applications (code included)
Date: Wed, 30 Mar 2005 11:15:11 -0500
Lines: 29
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: 65.205.162.31
Message-ID: <424ad08d$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1112199309 65.205.162.31 (30 Mar 2005 08:15:09 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail