Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Mouse Movement Outside Form [duplicate]

Tags:

c#

winforms

mouse

I am trying to track mouse movements in my code. It's easy to track mouse movements in form window but i wanted to track mouse movements outside of my from window. i mean i will minimize my from to tray and track where it is. Any idea how to track mouse movemtns outside of my form windows with sample codes or sample explanation links? I am using c# and i would like to know how. Thanks for your help.

For form windows i tried this link and it works perfectly.

What i want.

I want to get to know when user move mouse left to right or right to left and show message about warning.

I want my application as a service (actually its not so neccessary if you can help on form application it will be fair enough too) and startup with os. and track mouse movements and catch if user move his/her mouse left to right or right to left. Thats it. I hope this edit will be very specific explanation.

like image 693
Erdinç Avatar asked Dec 04 '13 21:12

Erdinç


1 Answers

To do this properly, I think you will need to use global hooks. This seems nice and is C# managed code.

like image 148
Francis Ducharme Avatar answered Nov 11 '22 06:11

Francis Ducharme