Dinesh
Dinesh

Reputation: 2066

Mouse coordinates on Screen

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

Answers (3)

Dinesh
Dinesh

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

Stu Mackellar
Stu Mackellar

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

Kyle Rosendo
Kyle Rosendo

Reputation: 25277

To do this, you'd need to P/Invoke to user32.dll and use SetWindowsHookEx().

Have a look here:

Upvotes: 1

Related Questions