
Pour savoir quels coordonnées mettre, on peut utiliser ce code :
Code : Tout sélectionner
lpPoint.point
Repeat
GetCursorPos_(lpPoint)
Debug "X = " + Str(lpPoint\X)
Debug "Y = " + Str(lpPoint\Y)
Debug ""
Delay(50)
ForEver
Code : Tout sélectionner
#D_Bas = 0 : #D_Haut = 1 : #D_Click = 2 : #D_DoubleClick = 3 ; bouton de droite
#G_Bas = 4 : #G_Haut = 5 : #G_Click = 6 : #G_DoubleClick = 8 ; Bouton de gauche
#M_Bas = 9 : #M_Haut = 10 : #M_Click = 11 : #M_DoubleClick = 12 ; bouton du milieu
Procedure MouseEvent(Ereignis.l)
Mem.l=GlobalAlloc_(0,8)
GetCursorPos_(Mem)
mouse_event_(Ereignis | $8000,PeekL(Mem)*($FFFF/GetSystemMetrics_(0)),PeekL(Mem+4)*($FFFF/GetSystemMetrics_(1)),0,GetMessageExtraInfo_())
GlobalFree_(Mem)
EndProcedure
Procedure MouseClick(Option.b)
Select Option
Case #G_Bas
MouseEvent($2)
Case #G_Haut
MouseEvent($4)
Case #G_Click
MouseEvent($2)
MouseEvent($4)
Case #G_DoubleClick
MouseEvent($2)
MouseEvent($4)
MouseEvent($2)
MouseEvent($4)
Case #D_Bas
MouseEvent($8)
Case #D_Haut
MouseEvent($10)
Case #D_Click
MouseEvent($8)
MouseEvent($10)
Case #D_DoubleClick
MouseEvent($8)
MouseEvent($10)
MouseEvent($8)
MouseEvent($10)
Case #M_Bas
MouseEvent($20)
Case #M_Haut
MouseEvent($40)
Case #M_Click
MouseEvent($20)
MouseEvent($40)
Case #M_DoubleClick
MouseEvent($20)
MouseEvent($40)
MouseEvent($20)
MouseEvent($40)
EndSelect
EndProcedure
Procedure MouseMove(DX.l,DY.l,AX.l,AY.l,VX.l,VY.l,Delay.l)
; Arguments : Depart X - Depart Y - Arrivée X - Arrivée Y - Vitesse X - Vitesse Y - Temps d'attente entre deux boucles)
If DX - AX > 0 ; Si on va vers la gauche
SensX = 1
EndIf
If DY- AY > 0 ; Si on va vers le haut
SensY = 1
EndIf
Repeat
If SensX = 1
If DX > AX
DX - VX
Else
DX = AX
EndIf
Else
If DX < AX
DX + VX
Else
DX = AX
EndIf
EndIf
If SensY = 1
If DY > AY
DY - VY
Else
DY = AY
EndIf
Else
If DY < AY
DY + VY
Else
DY = AY
EndIf
EndIf
SetCursorPos_(DX,DY)
If DX = AX And DY = AY : Break : EndIf
Delay(Delay)
ForEver
EndProcedure
SetCursorPos_(10,760) ; Place le curseur sur démarrer
MouseClick(#G_Click)
MouseMove(10,760,310,710,5,1,20)
MouseClick(#G_Click)
MouseMove(310,710,650,372,5,5,20)
MouseClick(#G_Click)