Re: hold mouse button down
This should do the trick
Code:
For i = 0 To 30
mouse_event MOUSEEVENTF_RIGHTDOWN, 0&, 0&, cButt, dwEI
Sleep 200
mouse_event MOUSEEVENTF_RIGHTUP, 0&, 0&, cButt, dwEI
Next i
Re: hold mouse button down
Sleep will not hold it down for a period of time i think.
Re: hold mouse button down
No it wont but if you manually click down the button and enable a timer control in the button_mousedown event, it can fire your repetitive task/function in the tick event and then disable the timer in the mouseup event it should give the effect you want.
Re: hold mouse button down
You can make it easier on him, instead of using a timer. You can try the DoEvents, and it should work.
Code:
For i = 0 To 30
mouse_event MOUSEEVENTF_RIGHTDOWN, 0&, 0&, cButt, dwEI
DoEvents
Sleep 200
mouse_event MOUSEEVENTF_RIGHTUP, 0&, 0&, cButt, dwEI
DoEvents
Next i