he agregado algi del codigo para que se entienda mejor
if not CheckPrevious.RestoreIfRunning(Application.Handle, 1) then
begin
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TForm1, Form1);
Application.CreateForm(TForm3, Form3);
Application.Restore;
Application.Run;
end
else
begin
EnumWindows(@EnumWindowsFunc,0);
if(Paramcount>0) then
begin
s:=Paramstr(1);
CopyData.lpData := PAnsiChar(s);
CopyData.cbData := length(s);
CopyData.dwData := 0;
sendMessage(found, WM_COPYDATA,0, integer(@CopyData));
end;
end;
|