Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
I have a windows form and trying to calculate something when the user moves the cursor. Is there an event handler on changing the cursor position.
Posted 15-Jan-13 7:12am
Comments
Sandeep Mewara at 15-Jan-13 13:28pm
   
Will not cursor position help in your something?
http://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.position%28v=vs.100%29.aspx
Jason Gleim at 15-Jan-13 14:56pm
   
Just a word of warning... you should hook and unhook those events as-needed. Obviously, MouseMove generates a crap-load of events so you should only hook your event handler just before you need the data and then unhook it when you are done. And you should keep your event handler short and sweet. If your handler takes longer to execute than it takes for the next event to arrive, you can fill the event queue and bog down your app and/or start dumping events.
 
Processing events is one thing, processing events that generate hundreds or thousands of interrupts per second is a whole different beast.
Sergey Alexandrovich Kryukov at 15-Jan-13 15:38pm
   
Mouse cursor or caret? In your application or outside?
—SA
missak boyajian at 16-Jan-13 10:01am
   
I already found a solution. I used Timer in winform controls and I am able to do what I needed. But thanks for the replies.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,
 
Use Hooks:
Global System Hooks in .NET[^]
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 6,656
1 Sergey Alexandrovich Kryukov 6,490
2 CPallini 5,310
3 George Jonsson 3,584
4 Gihan Liyanage 2,650


Advertise | Privacy | Mobile
Web04 | 2.8.140921.1 | Last Updated 15 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100