da C.Seehase meinen sourcecode mal sehen wollte, hier:
Delphi-Quellcode:
var MainApp:HWND; MyCopyDataStruct:TCopyDataStruct;
begin
if FindWindow(nil,Main_ID)<>0 then begin
MainApp:=FindWindow(nil,Main_ID);
if ParamCount>0 then begin
with MyCopyDataStruct do begin
dwData:=MY_SENTPARAM;
cbData:=Length(PChar(ParamStr(1)))+1;
lpData:=PChar(ParamStr(1));
end;
end else begin
with MyCopyDataStruct do begin
dwData:=MY_SHOWAPP;
cbData:=0;
lpData:=nil;
end;
end;
SendMessage(MainApp,WM_COPYDATA,0,Longint(@MyCopyDataStruct));
//Application.Terminate;
end else begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end;