SendInput

C# Signature:

/// <summary>
   /// Synthesizes keystrokes, mouse motions, and button clicks.
   /// </summary>
   [DllImport("user32.dll")]
   internal static extern uint SendInput (uint nInputs, 
      [MarshalAs(UnmanagedType.LPArray), In] INPUT[] pInputs, 
      int cbSize);

VB.NET Signature:

<DllImport("user32.dll", SetLastError:=True)>
Friend Shared Function SendInput(<[In]()> ByVal nInput As UInt32,
  <[In](), MarshalAs(UnmanagedType.LPArray, ArraySubtype:=UnmanagedType.Struct, SizeParamindex:=0)> ByVal pInputs() As tagINPUT,
  <[In]()> ByVal cbInput As Int32) As UInt32
End Function

VB Signature:

Private Declare Function SendInput Lib "user32.dll" (ByVal cInputs As Integer, ByRef pInputs As INPUT, ByVal cbSize As Integer) As Integer

Sample Code:

Sample Code:

Última actualización