Registriert seit: 18. Mai 2003
634 Beiträge
|
Re: Neustart des eigenen Programms
3. Sep 2004, 18:04
Jo! Ich machs auch immer so:
Delphi-Quellcode:
program Project1;
uses
Forms,
windows,
Sysutils,
Unit1 in ' Unit1.pas' {Form1};
{$R *.res}
var
s: string;
i:integer;
begin
if Paramcount >= 2 then
if Paramstr(1)=' abc' then
begin
for i:=1 to Length(Paramstr(2)) do
if (Paramstr(2)[i]>=' 0') and (Paramstr(2)[i]<=' 9') then
s:=s+Paramstr(2)[i];
while IsWindow(strtoint(s)) do
sleep(1);
end;
//Mutex erst hier einfügen
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
begin
ShellExecute( Handle, ' open', pchar(' "'+paramstr(0)+' "'), pchar(' abc '+inttostr( Handle)), nil, SW_SHOW);
close;
end;
|
|
Zitat
|