How can I simulate a mouse click at a certain position on the screen?
What I want to do is to manipulate the mouse. It will be a simple macro for my own purposes. So it will move my mouse to certain position on the screen and click like I am clicking with certain interval. Here's a code that is using unmanaged functions to simulate mouse clicks : //This is a replacement for Cursor.Position in WinForms [System.Runtime.InteropServices.DllImport("user32.dll")] static extern bool SetCursorPos(int x, int y); [System.Runtime.InteropServices.DllImport("user32.dll")] public static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);