vale vale -.-'' perdon , creia que no me haceis caso ami
pero necesito urgentemente hacer eso y no encuetro solucion
pero necesito urgentemente hacer eso y no encuetro solucion
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menú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