473,770 Members | 3,398 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get All Mouse Events

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 even if it not over a
form my app created. How can I do this. Like I said I know this is simple
I just can't remember it.
Nov 20 '05 #1
4 1466
Check out the MouseEventArgs, they contain Button, X, Y , Clicks, Empty and
Delta. Trapping MouseDown will get this for you.. HTH,

Bill
"Mike Bulava" <mb*****@comcas t.net> wrote in message
news:O$******** ******@TK2MSFTN GP09.phx.gbl...
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 even if it not over a
form my app created. How can I do this. Like I said I know this is simple I just can't remember it.

Nov 20 '05 #2
news:O$******** ******@TK2MSFTN GP09.phx.gbl...
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

(...)

You need to set up a global Hook for the mouse. It is a little bit tricky in
..NET, since .NET documentation says it does not support hooks, but...
http://groups.google.com/groups?hl=e...lcore.com+hook

sincerely,
--
Sebastian Zaklada
Skilled Software
http://www.skilledsoftware.com
*************** *************** ******
SQL Source Control 2003 - for
SQL Server Source Safe integration
and custom databases documentation
Nov 20 '05 #3
* "Mike Bulava" <mb*****@comcas t.net> scripsit:
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 even if it not over a
form my app created. How can I do this. Like I said I know this is simple


You will have to set up a global hook. Sample for keyboard hook (works
similar with a mouse hook):

<http://www.developer.c om/net/net/article.php/11087_2193301_1 >

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4

"Mike Bulava" <mb*****@comcas t.net> wrote in message
news:O$******** ******@TK2MSFTN GP09.phx.gbl...
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 even if it not over a
form my app created. How can I do this. Like I said I know this is simple I just can't remember it.

Thanks Guys I got it now. I just need to change a few things in the class
so that I can either raiseevents or Check properties of the mouse
Nov 20 '05 #5

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

Similar topics

5
6228
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 buttons, which is fine most of the time (he comes from a Mac environment, so I accept mouse clicks from the right or left button when he's working on the PC). But every once in a while, he'll press and hold the right mouse button, move onto a JButton,...
0
2696
by: Stephen Williams | last post by:
I am migrating a VB 6 PictureBox control to VB.NET. In VB 6, this control modified its border style during the mouse down and up events to provide user feedback that it was selected. Once selected its position was adjusted in accordance with the mouse move events. After migrating it to VB.NET I tried setting the PictureBox class's BorderStyle to Fixed3D or FixedSingle during the Mouse Down event. However, doing so seems to prevent...
1
9778
by: Jean-Gael GRICOURT | last post by:
I am trying to capture mouse events when entering and leaving a DIV layer. This test code works fine with IE 6.0 and Opera 7.21 but fails with Mozilla/Netscape. The strange thing is that the mouse events respond continuously whenever the mouse is moving inside the DIV area. Does anybody have a clue about what is happenning ? J2G
3
10652
by: red | last post by:
mouse events when the mouse is on a "child control" hi everyone; my problem: I have a userControl in this usercontrol, I have a child control (a button) when the mouse moves over the userControl, I can detect the movement using MouseMove event. the problem is when the mouse is on the child control : I can t detect
5
3768
by: Bill Henning | last post by:
Does anyone know a good method of preventing keyboard and mouse events from interrupting processing? My situation is: 1) I need to track and handle all key and mouse events 2) I need to perform processing on certain key/mouse events 3) If key/mouse events interrupt processing, the events should not be discarded since they need to be handled but AFTER the current processing is complete
3
4487
by: Rick Strahl [MVP] | last post by:
I'm working on an app that's using the WebBrowser control. I got the control working fine, hooking to the document object. But I've run into a major issue with hooking the Document events. Whenever I hook any of the HTMLDocumnetEvent2_Event events like this: HTMLDocumentEvents2_Event DocEvents = this.Browser.Document as HTMLDocumentEvents2_Event ; DocEvents.oncontextmenu += new...
3
3119
by: Charles Law | last post by:
In a user control, is it possible to replace the default mouse events with my own? In particular, I want the consumer of my control to get MouseMove events when the mouse is over my control, so that they can change the cursor. However, my control has several standard controls on it, and the consumer of my control only gets MouseMove events when the mouse is over the control itself, and not when it is over the standard controls....
2
15460
by: bretth | last post by:
In a VB.Net Windows Forms application, I have a user control that handles mouse events. Another section of code programmatically adds a label to the control. I would like label to ignore all events allowing the user control to react to the mouse click. Setting the Enabled property on the label to False comes close, but I don't want the font color to change. Does anyone have an idea how .NET implements the code behind the Enabled...
5
574
by: Adeel | last post by:
Hi group! I'm trying to learn C# on my own... I'd appreciate it very much if someone can help me out here. I have a basic form without any controls on it... I want to catch mouse clicks (both left and right). When I select the form and go to the events tab (the bolt icon in properties), it gives me several options to choose from...
0
9425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10002
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9869
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8883
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7415
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6676
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3970
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3575
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.