public static API_InputSimulator moveWindow(this API_InputSimulator inputSimulator, Process process, int left, int top, int width, int height)
        {
            var windowHandle = process.MainWindowHandle;

            API_InputSimulator_NativeMethods.MoveWindow(windowHandle, left, top, width, height, true);
            return(inputSimulator);
        }
        public static API_InputSimulator_NativeMethods.Rect windowRectangle(this API_InputSimulator inputSimulator, Process process)
        {
            var rect         = new API_InputSimulator_NativeMethods.Rect();
            var windowHandle = new HandleRef(null, process.MainWindowHandle);

            API_InputSimulator_NativeMethods.GetWindowRect(windowHandle, out rect);
            return(rect);
        }
        public static API_InputSimulator alwaysOnTop(this API_InputSimulator inputSimulator, Process process, bool value)
        {
            inputSimulator.window_Normal(process);                      // make sure the window is not minimized

            var HWND_TOPMOST   = new HandleRef(null, new IntPtr(-1));
            var HWND_NOTOPMOST = new HandleRef(null, new IntPtr(-2));

            var       windowHandle    = new HandleRef(null, process.MainWindowHandle);
            HandleRef hWndInsertAfter = value ? HWND_TOPMOST : HWND_NOTOPMOST;

            API_InputSimulator_NativeMethods.SetWindowPos(windowHandle, hWndInsertAfter, 0, 0, 0, 0, 3);
            return(inputSimulator);
        }