how send data record using SendMessage(..) in separate process

Posted by XBasic3000 on Stack Overflow See other posts from Stack Overflow or by XBasic3000
Published on 2010-06-17T01:51:42Z Indexed on 2010/06/17 1:52 UTC
Read the original article Hit count: 352

i use to send a data on two separate process but it fails. it works only under same process... this is concept.

//-----------------------------------------------------------------------------------
MainApps
//-----------------------------------------------------------------------------------

Type
   PMyrec = ^TMyrec; 
   TMyrec = Record
   name : string;
   add : string;
   age : integer;
end;

:OnButtonSend
var aData : PMyrec;
begin
   new(aData);
   aData.Name := 'MyName';
   aData.Add := 'My Address';
   aData.Age : 18;
   SendMessage(FindWindow('SubApps'),WM_MyMessage,0,Integer(@aData));
end;

//-----------------------------------------------------------------------------------
SubApps
//-----------------------------------------------------------------------------------

Type
   PMyrec = ^TMyrec; 
   TMyrec = Record
   name : string;
   add : string;
   age : integer;
end;

:OnCaptureMessage

var
  aData : PMyrec;
begin
  aData := PMyrec(Msg.LParam);
  showmessage(aData^.Name);
end;

© Stack Overflow or respective owner

Related posts about delphi

Related posts about process