Voila le code presque complet :
unit Unit6;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, XPMan;
type
TForm6 = class(TForm)
Button1: TButton;
Edit1: TEdit;
Edit2: TEdit;
Timer1: TTimer;
Button3: TButton;
Edit3: TEdit;
RadioGroup1: TRadioGroup;
RadioGroup2: TRadioGroup;
z: TXPManifest;
Edit4: TEdit;
Label1: TLabel;
Panel1: TPanel;
RadioGroup3: TRadioGroup;
Label2: TLabel;
Panel2: TPanel;
ComboBox1: TComboBox;
Label3: TLabel;
Panel3: TPanel;
Button2: TButton;
Button4: TButton;
procedure Button4Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Déclarations privées }
public
{ Déclarations publiques }
end;
var
Form6: TForm6;
implementation
{$R *.dfm}
procedure TForm6.Button1Click(Sender: TObject);
var Position: TPoint;
begin
GetCursorPos(Position);
Edit1.Text := IntToStr(Position.X);
Edit2.Text := IntToStr(Position.Y);
end;
procedure TForm6.Timer1Timer(Sender: TObject);
begin
Button3.Click;
Button4.Click;
end;
procedure TForm6.Button4Click(Sender: TObject);
Var X, Y, I : Integer;
Z : cardinal;
begin
Timer1.Enabled := true;
Z := Timer1.Interval;
Z := StrToInt(Edit3.Text);
Timer1.Interval := Z;
Timer1.Interval := Z * 60000;
begin
X := StrToInT(Edit1.Text);
Y := StrToInt(Edit2.Text);
end;
SetCursorPos(X, Y);
I := StrToInt(Edit4.Text);
For I := 1 to StrToInt(Edit4.Text) do
begin
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
Sleep(250);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
end; end;
procedure TForm6.Button3Click(Sender: TObject);
Var X, Y, I : Integer;
Z : cardinal;
begin
Timer1.Enabled := true;
Z := Timer1.Interval;
Z := StrToInt(EDit3.Text);
Timer1.Interval := Z;
Timer1.Interval := Z * 1000;
begin
X := StrToInT(Edit1.Text);
Y := StrToInt(Edit2.Text);
end;
SetCursorPos(X, Y);
I := StrToInt(Edit4.Text);
For I := 1 to StrToInt(Edit4.Text) do
begin
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
Sleep(250);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
end; end;
procedure TForm6.Button2Click(Sender: TObject);
begin
If ComboBox1.Items[ComboBox1.ItemIndex] = 'En seconde' then begin
Radiogroup1.visible := true;
Button3.Enabled := true;
Button3.Visible := true;
Edit3.Visible := true;
Button4.visible := false;
Button4.enabled := false;
end;
begin
If ComboBox1.Items[ComboBox1.ItemIndex] = 'En minute' then begin
Radiogroup1.visible := true;
Button4.Visible := true;
Button4.Enabled := true;
Edit3.Visible := true;
Button3.Visible := false;
Button3.Enabled := false;
end;
end; end;
end.
et le probleme c'est que quand je voudrai que ça clique à chaque foi tote les 10 seconde ça le fait la premiere fio et la 2eme foi ça ne marche plus.