Пример #1
0
        /// <summary>
        /// ウィンドウの表示領域を取得する
        /// </summary>
        public static Rectangle GetWindowBounds(IntPtr windowHandle)
        {
            var window = new Rectangle();

            User32NativeMethods.GetWindowRect(windowHandle, ref window);
            return(window);
        }
Пример #2
0
        public (int Left, int Top, int Right, int Bottom) GetWindowPosition(IntPtr handle)
        {
            User32NativeMethods.GetWindowRect(handle, out RECT windowRectangle);

            return(windowRectangle.Left, windowRectangle.Top, windowRectangle.Right, windowRectangle.Bottom);
        }