471,605 Members | 1,473 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,605 software developers and data experts.

Mouse Event

Is there a way to receive a message any time the mouse is clicked
anywhere on the screen? I would be kind of like a clicke event handler
for the entire screen.

Jan 5 '06 #1
2 1517
Use SetWindowsHookEx:

<DllImport("user32.dll")> _
Public Shared Function SetWindowsHookEx( _
ByVal idHook As Integer, _
ByVal lpfn As HookProc, _
ByVal hInstance As IntPtr, _
ByVal threadId As Integer) As Integer
End Function

<DllImport("user32.dll")> _
Public Shared Function UnhookWindowsHookEx(ByVal idHook As Integer) As
Boolean
End Function

<DllImport("user32.dll")> _
Public Shared Function CallNextHookEx( _
ByVal idHook As Integer, _
ByVal nCode As Integer, _
ByVal wParam As Integer, _
ByVal lParam As IntPtr) As Integer
End Function

--
Colin Neller
http://www.colinneller.com/blog
"Dave" <dc*****@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Is there a way to receive a message any time the mouse is clicked
anywhere on the screen? I would be kind of like a clicke event handler
for the entire screen.

Jan 5 '06 #2
Unfortunately this is not what the OP is looking for. Please read his other
postings; subject 'Monitor'..
Dave, please don't start multiple threads about the same issue, I replied to
your latest posting titled 'Monitor'.

Willy.

"Colin Neller" <cn*****@gmail.com> wrote in message
news:eo**************@TK2MSFTNGP15.phx.gbl...
Use SetWindowsHookEx:

<DllImport("user32.dll")> _
Public Shared Function SetWindowsHookEx( _
ByVal idHook As Integer, _
ByVal lpfn As HookProc, _
ByVal hInstance As IntPtr, _
ByVal threadId As Integer) As Integer
End Function

<DllImport("user32.dll")> _
Public Shared Function UnhookWindowsHookEx(ByVal idHook As Integer) As
Boolean
End Function

<DllImport("user32.dll")> _
Public Shared Function CallNextHookEx( _
ByVal idHook As Integer, _
ByVal nCode As Integer, _
ByVal wParam As Integer, _
ByVal lParam As IntPtr) As Integer
End Function

--
Colin Neller
http://www.colinneller.com/blog
"Dave" <dc*****@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Is there a way to receive a message any time the mouse is clicked
anywhere on the screen? I would be kind of like a clicke event handler
for the entire screen.


Jan 5 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by John Champaign | last post: by
9 posts views Thread by punkin | last post: by
3 posts views Thread by mitsura | last post: by
3 posts views Thread by Logan Mckinley | last post: by
3 posts views Thread by wanwan | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by MichaelMortimer | last post: by
reply views Thread by CCCYYYY | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.