Use WM_COPYDATA to send strings or other data to another application.
 
sample code:
var
  CopyData :TCopyDataStruct;
  s :String;
begin
  s:= 'Some string.....';
 
  CopyData.dwData:=  ;  //Message that identifies the data attached, can be any cardinal value meaningfull to the other app.
  CopyData.cbData:= Length(s);  //Size of the memory to be shared
  CopyData.lpData:= PChar(s);  //Address of the memory to be shared
 
  SendMessageTimeout(DestHWND, WM_COPYDATA, Self.Handle, LongInt(@CopyData),  SMTO_NORMAL, timeout, result);
end;
 
Hope that helps
 

_______________________
Allan D. Vergara
Software Engineer
Niche Software Ltd
http://www.WorkPace.com

 
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Ross Levis
Sent: Thursday, 6 November 2003 1:23 PM
To: Multiple recipients of list delphi
Subject: [DUG]: Sharing strings in 2 applications

I am colaborating with another developer so we can share some information between our 2 applications.  His app is written in C.  We currently send integer values using WM_USER messages by obtaining the Windows handle via FindWindow.  I would now like to provide a filename for the other app to read somehow.
 
Sharing strings between apps has come up before here a couple of years ago but I can't find the messages in the archive.  Anyone?
 
Thanks,
Ross Levis.
 

Reply via email to