I'm trying to write a program using C# that would allow me to remotely take control of the mouse on a windows machine. This would allow me to issue commands to the mouse to move to a certain part of the screen and then click on that part of the screen.
I was wondering if there were any C# classes that I would be useful in achieving this goal.
Any help is appreciated. Thanks!
I think unless you're just positioning the cursor over your own application, you have to use a windows api call. You can reference that in C# as such:
[DllImport("user32")]
public static extern int SetCursorPos(int x, int y);
There's source code for a more complete Win32 wrapper class here
You will have to write a client application that us run on the remote machine to receive your mouse movement command messages. That client application will then take control of the mouse, and move it to commanded coordinates.
There are several applications that allow remote desktop control. Microsoft supplies at least a couple (Netmeeting, Remote Desktops). VNC is another popular tool. Joel has his CoPilot built on VNC.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With