Reputation: 2066
How to track the mouse position on the screen regardless of application.i.e. Whenever the user clicks or select something with mouse in any application, i want to display my own menu at that point itself.
Is there any way to get mouse position on the screen using c#?
Upvotes: 0
Views: 712
Reputation: 2066
I have solved this issue, I used Low Level Mouse hooks and Low Level Keyboard hooks to implement the solution.
I am yet to add the Menu part of it.
Upvotes: 0
Reputation: 11638
That sounds like a bad idea. I'm sure you could force it with a bit of effort, but what about the other applications that may want to show their own menus when the mouse is clicked?
Upvotes: 0
Reputation: 25277
To do this, you'd need to P/Invoke to user32.dll and use SetWindowsHookEx()
.
Have a look here:
Upvotes: 1