You could try this:

In your application which is "Sending to the other" use this code

procedure SendToOtherWindow;
var
  CDS:TCopyDataStruct;
  DebugWin:hWnd;
  PMsg:PChar;
Begin
  DebugWin:=FindWindow('TAdrockfmDebug', nil);
  if DebugWin=0 then
     DebugWin:=StartDebugWin; { Start the program if it is not loaded }
  if DebugWin<>0 then
    Begin
      CDS.cbData:=7; { Length of the data +1 }
      PMsg:=StrNew(' Clear'); { My message }
      Try
        CDS.lpData:=PMsg;
        SendMessage(DebugWin, WM_COPYDATA, 0, LParam(@CDS));
      finally
        StrDispose(PMsg);
      end;
    end;
End;

In your application which is "Receiving the data" use this code

Add this to the declaration section of the class/form

procedure WM_COPYDATA(Var Message : TWMCopyData); message WM_COPYDATA;

Then add this

procedure TXXXXX.WM_COPYDATA(Var Message : TWMCopyData);
Var
  Line : String;
begin
  Line := StrPas(Message.CopyDataStruct.lpData);
end;

Chris Crowe

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Ebling
Sent: Monday, 27 September 1999 23:21
To: Multiple recipients of list delphi
Subject: [DUG]: Communication between exe files


Please,


How can I comunicate exe files?

I trying to use FindWindow and SendMessage, but I am with problems to send a
pchar parameter.
I using a command line like this:   SendMessage(FindWindow('TForm1',
'Form1'),PAM_Execute_This,Integer(pcharvariable),0);

Can an applications access the memory space of other application?

Thanks,
Paulo.
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to