public void DispatchInput(Win32Types.INPUT[] inputs){
     if (inputs == null) throw new ArgumentNullException("inputs");
     if (inputs.Length == 0) throw new ArgumentException("The input array was empty", "inputs");
     uint successful = Win32Declares.KeyBoard.SendInput((UInt32) inputs.Length, inputs,
         Marshal.SizeOf(new Win32Types.INPUT()));
     if (successful != inputs.Length)
         throw new Exception(
             "Some simulated input commands were not sent successfully. " +
             "The most common reason for this happening are the security features of Windows " +
             "including User Interface Privacy Isolation (UIPI). " +
             "Your application can only send commands to applications of the same or lower elevation. " +
             "Similarly certain commands are restricted to Accessibility/UIAutomation applications. " +
             "Refer to the project home page and the code samples for more information.");
 }
示例#2
0
 public static extern Win32Constants.ChangeDisplaySettingsResult ChangeDisplaySettings(ref Win32Types.DEVMODE devMode, Win32Constants.ChangeDisplaySettingsFlags flags);
示例#3
0
 public static extern int EnumDisplaySettings(string deviceName, Win32Constants.EnumDisplaySettings modeNum, ref Win32Types.DEVMODE devMode);
示例#4
0
 public static extern bool GetWindowPlacement(IntPtr hWnd, out Win32Types.WINDOWPLACEMENT lpwndpl);
示例#5
0
 public static extern bool GetWindowRect(IntPtr hWnd, out Win32Types.RECT lpRect);
示例#6
0
 public static extern IntPtr WindowFromPoint(Win32Types.POINT Point);
示例#7
0
 public static extern IntPtr ChildWindowFromPointEx(IntPtr hWndParent, Win32Types.POINT pt, Win32Constants.ChildWindowFromPointFlags childWindowFromPointFlags);
示例#8
0
 public static extern int CallNextKeyboardHook(int hHook, int ncode, int wParam, Win32Types.keybHookStruct lParam);
示例#9
0
 public static extern uint SendInput(uint nInputs, Win32Types.INPUT[] pInputs, int cbSize);
示例#10
0
 private void SendSimulatedInput(Win32Types.INPUT[] inputList){
     _messageDispatcher.DispatchInput(inputList);
 }