Click to See Complete Forum and Search --> : Mouse buttons via API
essohbee
May 6th, 2000, 09:28 PM
How do I find you which mousebuttons currently being pressed no matter where the mouse-pointer is nor what program or window that has focus?
AND
Is there some way of block these clicks, so I could disable right-click?
Razzle
May 6th, 2000, 11:13 PM
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Const VK_LBUTTON = &H1
Private Const VK_RBUTTON = &H2
Private Sub Timer1_Timer()
If GetAsyncKeyState(VK_LBUTTON) <> 0 Then MsgBox "Left Mouse Button"
If GetAsyncKeyState(VK_RBUTTON) <> 0 Then MsgBox "Right Mouse Button"
End Sub
Timer interval must be very low (e.g. 1 ms)
essohbee
May 6th, 2000, 11:46 PM
Okay, thanks, it works just fine :)
1 down, 1 to go, so if anyone knows how to intercept
the call that spawns the "right-click" menu and kill it,
please don't hesitate to write me, your help will be
greatly appreciated.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.