Lo que me pasa es lo siguiente
Al hora de hacer clik la flecha se queda blockeada en el sitio donde puse las coordenadas que de click
Vi otros autocliks como el Caos que no se queda la flecha blockeada alguien me puede ayudar ?
El codigo que llevo asta el momento es este :
Código:
Public Class Form1
Dim encendido As Boolean = True
Dim apagado As Boolean = False
Function clickeo() As String 'hace que el mouse clickee
mouse_event(mousclickdown, 0, 0, 0, 0)
mouse_event(mousclickup, 0, 0, 0, 0)
Return 0
End Function
Private Declare Sub mouse_event Lib "user32" (ByVal dvflags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cbuttons As Long, ByVal dvextrainfo As Long)
Private Const mousclickup = 4
Private Const mousclickdown = 2
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Button1: Timer1.Start()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Button2: Timer1.Stop()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.Cursor = New Cursor(Cursor.Current.Handle)
Cursor.Position = New Point(Label2.Text, Label1.Text)
clickeo()
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Label2.Text = MousePosition.X
Label1.Text = MousePosition.Y
Timer2.Stop()
End Sub
Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
If encendido = True Then
Dim hotkey As Boolean
hotkey = GetAsyncKeyState(Keys.F1)
If hotkey = True Then Timer1.Start()
apagado = True
encendido = False
ElseIf apagado = True Then
Dim hotkey1 As Boolean
hotkey1 = GetAsyncKeyState(Keys.F1)
If hotkey1 = True Then Timer1.Stop()
apagado = False
encendido = True
End If
End Sub
Private Sub Timer5_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer5.Tick
Dim hotkey As Boolean
hotkey = GetAsyncKeyState(Keys.F9)
If hotkey = True Then Timer2.Start()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Application.Exit()
End Sub
End Class
Dim encendido As Boolean = True
Dim apagado As Boolean = False
Function clickeo() As String 'hace que el mouse clickee
mouse_event(mousclickdown, 0, 0, 0, 0)
mouse_event(mousclickup, 0, 0, 0, 0)
Return 0
End Function
Private Declare Sub mouse_event Lib "user32" (ByVal dvflags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cbuttons As Long, ByVal dvextrainfo As Long)
Private Const mousclickup = 4
Private Const mousclickdown = 2
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Button1: Timer1.Start()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Button2: Timer1.Stop()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.Cursor = New Cursor(Cursor.Current.Handle)
Cursor.Position = New Point(Label2.Text, Label1.Text)
clickeo()
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Label2.Text = MousePosition.X
Label1.Text = MousePosition.Y
Timer2.Stop()
End Sub
Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
If encendido = True Then
Dim hotkey As Boolean
hotkey = GetAsyncKeyState(Keys.F1)
If hotkey = True Then Timer1.Start()
apagado = True
encendido = False
ElseIf apagado = True Then
Dim hotkey1 As Boolean
hotkey1 = GetAsyncKeyState(Keys.F1)
If hotkey1 = True Then Timer1.Stop()
apagado = False
encendido = True
End If
End Sub
Private Sub Timer5_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer5.Tick
Dim hotkey As Boolean
hotkey = GetAsyncKeyState(Keys.F9)
If hotkey = True Then Timer2.Start()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Application.Exit()
End Sub
End Class