Send mouse & keyboard events
I'm developing an app that have to send some keys or mouse events to the active window. I'm using this class: Mouse using System.Runtime.InteropServices; using System.Windows.Forms; namespace Mouse { public static class VirtualMouse { // import the necessary API function so .NET can // marshall parameters appropriately [DllImport("user32.dll")] static extern void mouse_event(int dwFlags, int dx, int dy, int dwData, int dwExtraInfo); // constants for the mouse_input() API function private const int MOUSEEVENTF_MOVE = 0x0001; private const int MOUSEEVENTF_LEFTDOWN = 0x0002; private const int