コード例 #1
0
ファイル: MouseSimulator.cs プロジェクト: burstas/rmps
 /// <summary>
 /// Sends the list of <see cref="INPUT"/> messages using the <see cref="IInputMessageDispatcher"/> instance.
 /// </summary>
 /// <param name="inputList">The <see cref="System.Array"/> of <see cref="INPUT"/> messages to send.</param>
 /// <returns>The number of successful messages that were sent.</returns>
 private int SendSimulatedInput(INPUT[] inputList)
 {
     if (inputList == null || inputList.Length == 0) return -1;
     return (int)_messageDispatcher.DispatchInput(inputList);
 }
コード例 #2
0
ファイル: User32API.cs プロジェクト: burstas/rmps
 internal static extern UInt32 SendInput(UInt32 numberOfInputs, INPUT[] inputs, Int32 sizeOfInputStructure);
コード例 #3
0
 /// <summary>
 /// Dispatches the specified list of <see cref="INPUT"/> messages in their specified order by issuing a single called to <see cref="NativeMethods.SendInput"/>.
 /// </summary>
 /// <param name="inputs">The list of <see cref="INPUT"/> messages to be dispatched.</param>
 /// <returns>
 /// The number of <see cref="INPUT"/> messages that were successfully dispatched.
 /// </returns>
 public UInt32 DispatchInput(INPUT[] inputs)
 {
     return User32API.SendInput((UInt32)inputs.Count(), inputs.ToArray(), Marshal.SizeOf(typeof(INPUT)));
 }