|
-
January 26th, 2000, 11:20 PM
#1
Global detection of mouseclick
How to detect if mouse had been clicked anywhere on the screen, not only form....
Thank You
-
January 27th, 2000, 07:53 AM
#2
Re: Global detection of mouseclick
check out this article on vbaccelerator
http://vbaccelerator.com/codelib/hook/vbalhook.htm
it tells you everything about hooks and how to use the in vb
-
January 27th, 2000, 07:55 AM
#3
Re: Global detection of mouseclick
on second thought...
you could also use GetAsyncKeyState API to find out if a certain mouse button has been pressed.
-
January 27th, 2000, 03:02 PM
#4
Re: Global detection of mouseclick
hmm, this is not exactly what I needed I meant global as if the mouse was pressed anywhere on the screen not on the form or control only, even if I doubleclick "My Computer" and form is minimized it still detects mouse click, about GetAsyncKeyState I'll see if I can figure out how to make it work, because I had never used it before, anyway thank you from replying
-
January 27th, 2000, 04:50 PM
#5
Re: Global detection of mouseclick
Here's how you can use the GetAsyncKeyState API:
private Declare Function GetAsyncKeyState Lib "user32" (byval vKey as Long) as Integer
private Const VK_LBUTTON = &H1
private Const VK_RBUTTON = &H2
private Sub Form_Load()
Timer1.Interval = 100
End Sub
private Sub Timer1_Timer()
If GetAsyncKeyState(VK_LBUTTON) then
Caption = "Left Click"
ElseIf GetAsyncKeyState(VK_RBUTTON) then
Caption = "Right Click"
else
Caption = ""
End If
End Sub
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
February 1st, 2000, 11:21 AM
#6
Re: Global detection of mouseclick
Thanks a lot for helping )
[]'s
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|