Esempio n. 1
0
 public static IntPtr CreateRectRgnIndirect(RECT lprc)
 {
     var ret = _CreateRectRgnIndirect(ref lprc);
     if (IntPtr.Zero == ret)
     {
         throw new Win32Exception();
     }
     return ret;
 }
Esempio n. 2
0
        private RECT _GetAdjustedWindowRect(RECT rcWindow)
        {
            // This should only be used to work around issues in the Framework that were fixed in 4.0
            Assert.IsTrue(Utility.IsPresentationFrameworkVersionLessThan4);

            var style = (WS)NativeMethods.GetWindowLongPtr(_hwnd, GWL.STYLE);
            var exstyle = (WS_EX)NativeMethods.GetWindowLongPtr(_hwnd, GWL.EXSTYLE);

            return NativeMethods.AdjustWindowRectEx(rcWindow, style, false, exstyle);
        }
Esempio n. 3
0
 private static extern bool _GetWindowRect(IntPtr hWnd, out RECT lpRect);
Esempio n. 4
0
 private static extern bool _AdjustWindowRectEx(ref RECT lpRect, WS dwStyle,
     [MarshalAs(UnmanagedType.Bool)] bool bMenu, WS_EX dwExStyle);
Esempio n. 5
0
        internal static RECT AdjustWindowRectEx(RECT lpRect, WS dwStyle, bool bMenu, WS_EX dwExStyle)
        {
            // Native version modifies the parameter in place.
            if (!_AdjustWindowRectEx(ref lpRect, dwStyle, bMenu, dwExStyle))
            {
                HRESULT.ThrowLastError();
            }

            return lpRect;
        }
Esempio n. 6
0
 public static RECT Union(RECT rect1, RECT rect2)
 {
     return new RECT
     {
         Left = Math.Min(rect1.Left, rect2.Left),
         Top = Math.Min(rect1.Top, rect2.Top),
         Right = Math.Max(rect1.Right, rect2.Right),
         Bottom = Math.Max(rect1.Bottom, rect2.Bottom)
     };
 }