473,395 Members | 1,692 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

VB 2005 - How to hook into Windows to intercept all mouse events?

I'm trying to write a small application that intercepts middle clicks
anywhere in the Windows environment. I want to perform different actions,
based on the application that the mouse pointer was over at the time of the
middl click.

How does one insert a hook into Windows for a VB 2005 to act on system mouse
clicks?

Thx
Jan 11 '06 #1
5 13096
Hi,

http://msdn.microsoft.com/msdnmag/is...0/CuttingEdge/

Ken
-------------
"Noozer" <do*******@me.here> wrote in message
news:0IZwf.292139$ki.82383@pd7tw2no...
I'm trying to write a small application that intercepts middle clicks
anywhere in the Windows environment. I want to perform different actions,
based on the application that the mouse pointer was over at the time of
the middl click.

How does one insert a hook into Windows for a VB 2005 to act on system
mouse clicks?

Thx

Jan 11 '06 #2

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:ul**************@TK2MSFTNGP14.phx.gbl...
Hi,

http://msdn.microsoft.com/msdnmag/is...0/CuttingEdge/

So it's impossible to do a global hook then? I don't read C too well.
Jan 11 '06 #3
Hi,

No it is possible. The samples there are c# which convert easily to
vb.net.

Here is an example of a windows hook that notifies you when a device is
plugged in to the usb port.

http://www.vb-tips.com/default.aspx?...0-f3826480a706

Ken
---------------------
"Noozer" <do*******@me.here> wrote in message
news:gi2xf.294938$ki.131402@pd7tw2no...

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:ul**************@TK2MSFTNGP14.phx.gbl...
Hi,

http://msdn.microsoft.com/msdnmag/is...0/CuttingEdge/

So it's impossible to do a global hook then? I don't read C too well.

Jan 11 '06 #4
Thanks Ken!

It's appreciated!
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi,

No it is possible. The samples there are c# which convert easily
to vb.net.

Here is an example of a windows hook that notifies you when a device is
plugged in to the usb port.

http://www.vb-tips.com/default.aspx?...0-f3826480a706

Ken
---------------------
"Noozer" <do*******@me.here> wrote in message
news:gi2xf.294938$ki.131402@pd7tw2no...

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:ul**************@TK2MSFTNGP14.phx.gbl...
Hi,

http://msdn.microsoft.com/msdnmag/is...0/CuttingEdge/

So it's impossible to do a global hook then? I don't read C too well.


Jan 11 '06 #5
Noozer,

In addition, I have a VB.NET example of hooking mouse (and keyboard) events
on my blog:
http://www.colinneller.com/blog/Perm...e5918a39c.aspx

--
Colin Neller
http://www.colinneller.com/blog

"Noozer" <do*******@me.here> wrote in message
news:xgfxf.305760$ki.30154@pd7tw2no...
Thanks Ken!

It's appreciated!
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi,

No it is possible. The samples there are c# which convert easily
to vb.net.

Here is an example of a windows hook that notifies you when a device is
plugged in to the usb port.

http://www.vb-tips.com/default.aspx?...0-f3826480a706

Ken
---------------------
"Noozer" <do*******@me.here> wrote in message
news:gi2xf.294938$ki.131402@pd7tw2no...

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:ul**************@TK2MSFTNGP14.phx.gbl...
Hi,

http://msdn.microsoft.com/msdnmag/is...0/CuttingEdge/
So it's impossible to do a global hook then? I don't read C too well.



Jan 12 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: John Champaign | last post by:
Hi all, I'm working on an educational applet for a child with special needs. He's got a bit of a trick to make my life more difficult... To interact with the applet he needs to click on...
0
by: hades5k | last post by:
Hi, I need to intercept mouse click events outside my applications. What I want to do is pretty simple. If I click on the Quick Launch toolbar an icon (let say IExplorer), I want to intercept the...
3
by: Jason | last post by:
I'm trying to implement some pretty basic behavior in c#/.net 1.1 Forms but can't seem to find all the requisite pieces. When a user clicks on the background of the form, I want the app to start...
4
by: Mike Bulava | last post by:
I know this has to be something stupid I'm forgetting. Any time a mouse button is clicked (any mouse button) I want get all the information about where the Pointer is, what button was clicked, etc...
3
by: Lance | last post by:
I've noticed that controls that are contained in MDI child forms fail to raise MouseLeave events if the MDI child form's MdiParent property is set to Nothing (after it was set to an existing MDI...
1
by: petarm | last post by:
Hi All, I am trying to figure out if it is possible to send mouse events (or any other windows events) to windows that don't belong to the current application. I am trying to do this in C# using...
0
by: Elmar Jacobs | last post by:
hi guys, i have a c# CF model- view- controll application and the problem that i whant to handle the key and mouse events in the control class. the type of the control class is a normal class....
0
by: Gamey | last post by:
I have an application that NEEDS (don't ask) to handle additional mouse and keyboard processing during DoDragDrop. Normally, DoDragDrop kindly squashes all keyboard and mouse events. Alternate,...
1
by: zon7 | last post by:
I want my program to capture a part of the screen by drawing a rectangle with the mouse. But as I click the mouse out of the form, the program lost the focus. Is there any way to do this? For...
6
by: =?Utf-8?B?TXJOb2JvZHk=?= | last post by:
I mught have misunderstood how SetCapture works, but I call it passing my form's Handle and I am not noticing any difference in what mouse events my app is picking up. It is only limited to mouse...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.