/// <summary> /// Synthesizes mouse motion and button clicks. Function of same name was superseded by SendInput. /// Use as described by: http://msdn.microsoft.com/en-us/library/ms646260%28v=vs.85%29.aspx /// </summary> public static void MouseEvent(int dwFlags, int dx, int dy, int dwData) { SendInputClass.INPUT input = new SendInputClass.INPUT(); input.mi.dwFlags = dwFlags; input.mi.dx = dx; input.mi.dy = dy; input.mi.dwData = dwData; SendInputClass.INPUT[] inputArr = { input }; SendInputClass.SendInput(1, inputArr, Marshal.SizeOf(input)); }