Originally Posted by
Maniac101
ok so i think i over thought something or im missing something small here i want this to activate on the mousedown and deactivate on mouseup after the button is clicked
so it would be like this
1Click button
2press and hold mouse to active
3depress mouse to deactivate
heres my code im trying any ideas
[php]Public Class Form1
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Int32) As Int16
Private Declare Sub mouse_event Lib "user32" (ByVal dwflags As Int32, ByVal dx As Int32, ByVal dy As Int32, ByVal cbuttons As Int32, ByVal dwExtraInfo As Int32)
Private Const LButtonDown = &H2
Private Const LButtonUp = &H4
Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX1.Click
Do Until Timer1.Enabled = False
mouse_event(LButtonDown, 0, 0, 0, 0)
mouse_event(LButtonUp, 0, 0, 0, 0)
Loop
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If GetAsyncKeyState(LButtonDown) = True Then
Timer1.Enabled = True
Else
Timer1.Enabled = False
End If
End Sub
End Class[/php]
i had it working but as soon as you pressed the button it spammed mouse click (like it should when the mouse button is held down) and yea i have this annoying error beep going on now i just muted it lol dont feel like restarting