Click here to Skip to main content
15,889,211 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guys, just want to ask if it is possible to stop or to limit the cursor position at specific place. I want to stop moving my cursor at specific point. Thanks Guys
Posted
Comments
Sergey Alexandrovich Kryukov 11-Sep-13 23:15pm    
Why? Never saw anything like that. And I can imaging how could it confuse the user... Many will reboot the system... :-)
—SA

1 solution

Hi. try this method:
1- add using System.Runtime.InteropServices;
2- handle event of Mouse when you change the cursor position
3- create a If block and your condition must be cursor position.
4-when cursor is near to your favorite area then call following method:
C#
[DllImport("user32.dll")]
        private static extern bool SetCursorPos(int xCoordinate, int yCoordinate);

xCoordinate and yCoordinate must be any point, out of limited area.
i hope this help you.
good luck
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900