Hier mein (funktionierender) Code:
Code: Alles auswählen
procedure TForm1.Timer2Timer(Sender: TObject);
VAR
ex:TProcess;
begin
//tp.X:=TMouse.CursorPos.X;
//tp.Y:=TMouse.CursorPos.Y;
tp:=Maus.CursorPos;
if mp = tp.X + tp.Y then
begin
if momo = dur then
begin
ex:=TProcess.Create(Form1);
ex.CommandLine:='"'+cmd+'"';
Timer1.Enabled:=false;
ex.Execute;
close;
end;
momo:=momo + 1;
mp:=tp.X + tp.Y;
Memo1.Lines.Add(inttostr(mp)+':'+inttostr(momo));
end
else
begin
momo:=0;
mp:=tp.X + tp.Y;
Memo1.Lines.Add(inttostr(mp)+':'+inttostr(momo));
end;
end;