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."); }
public static extern Win32Constants.ChangeDisplaySettingsResult ChangeDisplaySettings(ref Win32Types.DEVMODE devMode, Win32Constants.ChangeDisplaySettingsFlags flags);
public static extern int EnumDisplaySettings(string deviceName, Win32Constants.EnumDisplaySettings modeNum, ref Win32Types.DEVMODE devMode);
public static extern bool GetWindowPlacement(IntPtr hWnd, out Win32Types.WINDOWPLACEMENT lpwndpl);
public static extern bool GetWindowRect(IntPtr hWnd, out Win32Types.RECT lpRect);
public static extern IntPtr WindowFromPoint(Win32Types.POINT Point);
public static extern IntPtr ChildWindowFromPointEx(IntPtr hWndParent, Win32Types.POINT pt, Win32Constants.ChildWindowFromPointFlags childWindowFromPointFlags);
public static extern int CallNextKeyboardHook(int hHook, int ncode, int wParam, Win32Types.keybHookStruct lParam);
public static extern uint SendInput(uint nInputs, Win32Types.INPUT[] pInputs, int cbSize);
private void SendSimulatedInput(Win32Types.INPUT[] inputList){ _messageDispatcher.DispatchInput(inputList); }