public static Size GetClientSize(Process proc)
        {
            Pinvokes.RECT rect;
            Pinvokes.GetWindowRect(proc.MainWindowHandle, out rect);

            Size size = new Size(rect);

            return(size);
        }
        public static bool LockToProcess(Process process)
        {
            Pinvokes.RECT windowRect, clientRect;
            Pinvokes.GetWindowRect(process.MainWindowHandle, out windowRect);
            Pinvokes.GetClientRect(process.MainWindowHandle, out clientRect);

            int borderThickness    = ((windowRect.Right - windowRect.Left) - clientRect.Right) / 2;
            int topBorderThickness = (windowRect.Bottom - windowRect.Top) - clientRect.Bottom;

            Pinvokes.RECT lockPosition;
            lockPosition.Left   = windowRect.Left + borderThickness;
            lockPosition.Right  = clientRect.Right + windowRect.Left + borderThickness;
            lockPosition.Top    = windowRect.Top + topBorderThickness - borderThickness;
            lockPosition.Bottom = clientRect.Bottom + windowRect.Top + topBorderThickness - borderThickness;

            return(Pinvokes.ClipCursor(ref lockPosition));
        }
        public static void ResizeWindow(Process process)
        {
            // TODO: Drop this reference to winforms and PInvoke it?
            Screen currentOccupiedScreen = Screen.FromHandle(process.MainWindowHandle);

            Pinvokes.RECT procRect;
            Pinvokes.GetWindowRect(process.MainWindowHandle, out procRect);

            // TODO: Repair this: It seems to have a bit too much size like 1926x1102 which makes everything broken.
            int width  = procRect.Right - procRect.Left;
            int height = procRect.Bottom - procRect.Top;

            Pinvokes.SetWindowPos(
                process.MainWindowHandle
                , 0
                , currentOccupiedScreen.Bounds.X
                , currentOccupiedScreen.Bounds.Y
                , currentOccupiedScreen.Bounds.Width
                , currentOccupiedScreen.Bounds.Height
                , (uint)WindowSizing.SWP_FRAMECHANGED
                );
        }