Example #1
0
 public static int sendMouseMove( int moveX, int moveY )
 {
     INPUT[] inputs = new INPUT[1];
     inputs[0] = new INPUT();
     inputs[0].type = INPUT_MOUSE;
     inputs[0].mi.dx = moveX;
     inputs[0].mi.dy = moveY;
     inputs[0].mi.mouseData = 0;
     inputs[0].mi.dwFlags = MOUSEEVENTF_MOVE;
     inputs[0].mi.time = 0;
     inputs[0].mi.dwExtraInfo = IntPtr.Zero;
     uint result = SendInput( 1, inputs, Marshal.SizeOf( inputs[0] ) );
     return result == 0 ? Marshal.GetLastWin32Error() : 0;
 }
Example #2
0
 private static extern uint SendInput( uint nInputs, INPUT[] pInputs,
                                      int cbSize );