Newsgroups : Borland : borland.public.delphi.rtl.win32 : 2006 Nov : BroadcastSystemMessage and passing data between apps. It works but how?

www.cryer.info
Managed Newsgroup Archive

BroadcastSystemMessage and passing data between apps. It works but how?

Subject:BroadcastSystemMessage and passing data between apps. It works but how?
Posted by:"Lars Sondergaard" (sorry@nospam.dk)
Date:26 Nov 2006 06:38:53

Hi,

In the documentation for an app. written by someone else it says:

Call RegisterWindowsMessage(PChar('SOMEUNIQUESTRING')) and then monitor
the windows procedure for the registred message ID.
When the message is received lParam will contain a pointer PChar to a
string containing the data.

This means that in that app. there must be code like this:

var
  S: string;

S := 'Pass this data to other application';
BroadcastSystemMessage(BSF_POSTMESSAGE,@Recipients,MsgID, 0,
Integer(PChar(S)));


But there is something I don't understand here. The two applications
have different memory address spaces so how can this work?
In other words how can the other application fill data and pass a
pointer to that data that my application can actually access?

As its actually working my question is more out of curiosity than
anything else :-)
Hope someone here can educate me. Thanks in advance.


--
Lars Sondergaard

Replies:

www.cryer.info
Managed Newsgroup Archive