Code: Alles auswählen
ListBox1: TListBox;
ListBox2: TListBox;
ListBox3: TListBox;
StringGrid1: TStringGrid;
Timer1: TTimer;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
uses windows;
procedure waith(l: byte);
var i,j,k: integer;
begin
if l=0then exit;
for j:=0 to l do for k:=0 to 60 do begin
sleep(1000*60);
application.ProcessMessages;
end;
end;
procedure waitm(m: byte);
var i: byte;
begin if m=0 then exit;
for i:=0 to m do begin
sleep(1000*60);
application.ProcessMessages;
end;
end;
procedure putetin(x,y: string);
begin
with form1 do
begin
stringgrid1.RowCount:=stringgrid1.RowCount+1;
stringgrid1.Cells[0,1]:=x;
stringgrid1.Cells[1,1]:=y;
end;
end;
procedure klick(sx,sy: string);
var p: tpoint;
begin
p.x:=strtoint(sx); p.y:=strtoint(sy);
mouse.CursorPos:=p;
mouse_event(MOUSEEVENTF_LEFTDOWN, p.x, p.y, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, p.x, p.y, 0,0);
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var p: tpoint;
begin
p:=mouse.CursorPos;
edit1.text:=inttostr(p.x);
edit2.text:=inttostr(p.y);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
stringgrid1.Cells[0,0]:='X';
stringgrid1.Cells[1,0]:='Y';
stringgrid1.Cells[2,0]:='n. Aktion(s)';
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
putetin(edit1.text,edit2.text);
end;
procedure TForm1.Button2Click(Sender: TObject);
var i,j: integer; p:point; s,s1: string;
begin
for i:=0 to strtoint(edit6.text) do
begin
for j:=1 to stringgrid1.RowCount-1 do begin
s:=stringgrid1.cells[0,j];s1:=stringgrid1.cells[1,j];
klick(s,s1);
s:=stringgrid1.Cells[2,j];
sleep(strtoint(s)*1000);
application.ProcessMessages;
end;
waith(strtoint(edit3.text));
waitm(strtoint(edit4.text));
sleep(strtoint(edit5.text))
end;
end;
Wenn ich es kompilire, kommt keine Fehlermeldung, aber wenn ich auf button2 klicke kommt:
"" Is an Invailed Integer