Profile

Click to view full profile
Hi, I'm Veerapat Sriarunrungrueang, an expert in technology field, especially full stack web development and performance testing.This is my coding diary. I usually develop and keep code snippets or some tricks, and update to this diary when I have time. Nowadays, I've been giving counsel to many well-known firms in Thailand.
view more...

Tuesday, September 11, 2012

Auto Mouse Move in C#

In .NET platform, it allows us to access a cursor of the mouse, and intercept accessibility from external environment (user input). It's quite easy to do so, just import "System.Windows.Forms", then play with Cursor class using static property "Cursor.Position". The property Position is from "System.Drawing" so you need to import this too in order to play with cursor position. The following code is an example program:
public static void Main()
{
     // Move cursor to (100, 100)
     Cursor.Position = new Point(100, 100);
}
Download full example program here.

No comments:

Post a Comment