コード例 #1
0
        /// <devdoc>
        ///     A rectangle representing the window region set with the SetWindowRgn function.
        /// </devdoc>
        public Rectangle ToRectangle()
        {
            if (this.IsInfinite)
            {
                return(new Rectangle(-int.MaxValue, -int.MaxValue, int.MaxValue, int.MaxValue));
            }

            IntNativeMethods.RECT rect = new IntNativeMethods.RECT();
            IntUnsafeNativeMethods.GetRgnBox(new HandleRef(this, this.nativeHandle), ref rect);
            return(new Rectangle(new Point(rect.left, rect.top), rect.Size));
        }