10/03/11 14:55
burillo997
ciao a tutti
ho creato un progetto in vb.net che clicca ripetute volte con il tasto sinistro del mouse
ecco il codice:
Public Class Form1
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Const MOUSELEFTDOWN = &H2
Private Const MOUSELEFTUP = &H4
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
timer1.start()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
timer1.stop()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
mouse_event(MOUSELEFTDOWN, 0, 0, 0, 0)
mouse_event(MOUSELEFTUP, 0, 0, 0, 0)
End Sub
End Class
il problema è che io voglio che clicchi col tasto destro non col sinistro come posso fare?
ho creato un progetto in vb.net che clicca ripetute volte con il tasto sinistro del mouse
ecco il codice:
Public Class Form1
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Const MOUSELEFTDOWN = &H2
Private Const MOUSELEFTUP = &H4
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
timer1.start()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
timer1.stop()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
mouse_event(MOUSELEFTDOWN, 0, 0, 0, 0)
mouse_event(MOUSELEFTUP, 0, 0, 0, 0)
End Sub
End Class
il problema è che io voglio che clicchi col tasto destro non col sinistro come posso fare?
aaa