當前位置: 首頁>>代碼示例>>C#>>正文


C# Standard.RECT類代碼示例

本文整理匯總了C#中Standard.RECT的典型用法代碼示例。如果您正苦於以下問題:C# RECT類的具體用法?C# RECT怎麽用?C# RECT使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


RECT類屬於Standard命名空間,在下文中一共展示了RECT類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: _GetWindowRect

 private static extern bool _GetWindowRect(IntPtr hWnd, out RECT lpRect);
開發者ID:JianwenSun,項目名稱:cc,代碼行數:1,代碼來源:NativeMethods.cs

示例2: AdjustWindowRectEx

        public 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;
        }
開發者ID:JianwenSun,項目名稱:cc,代碼行數:10,代碼來源:NativeMethods.cs

示例3: CreateRectRgnIndirect

 public static IntPtr CreateRectRgnIndirect(RECT lprc)
 {
     IntPtr ret = _CreateRectRgnIndirect(ref lprc);
     if (IntPtr.Zero == ret)
     {
         throw new Win32Exception();
     }
     return ret;
 }
開發者ID:JianwenSun,項目名稱:cc,代碼行數:9,代碼來源:NativeMethods.cs

示例4: _AdjustWindowRectEx

 private static extern bool _AdjustWindowRectEx(ref RECT lpRect, WS dwStyle, [MarshalAs(UnmanagedType.Bool)] bool bMenu, WS_EX dwExStyle);
開發者ID:JianwenSun,項目名稱:cc,代碼行數:1,代碼來源:NativeMethods.cs

示例5: Union

 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),
     };
 }
開發者ID:JianwenSun,項目名稱:cc,代碼行數:10,代碼來源:NativeMethods.cs

示例6: _GetAdjustedWindowRect

        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);
        }
開發者ID:JeremyDurnell,項目名稱:ChromeTabs,代碼行數:10,代碼來源:WindowChromeWorker.cs

示例7: AdjustWorkingAreaForAutoHide

        private static RECT AdjustWorkingAreaForAutoHide(IntPtr monitorContainingApplication, RECT area)
        {
            // maybe we can use ReBarWindow32 isntead Shell_TrayWnd
            IntPtr hwnd = NativeMethods.FindWindow("Shell_TrayWnd", null);
            IntPtr monitorWithTaskbarOnIt = NativeMethods.MonitorFromWindow(hwnd, (uint)MonitorOptions.MONITOR_DEFAULTTONEAREST);

            var abd = new APPBARDATA();
            abd.cbSize = Marshal.SizeOf(abd);
            abd.hWnd = hwnd;
            NativeMethods.SHAppBarMessage((int)ABMsg.ABM_GETTASKBARPOS, ref abd);
            bool autoHide = Convert.ToBoolean(NativeMethods.SHAppBarMessage((int)ABMsg.ABM_GETSTATE, ref abd));

            if (!autoHide || !Equals(monitorContainingApplication, monitorWithTaskbarOnIt))
            {
                return area;
            }

            switch (abd.uEdge)
            {
                case (int)ABEdge.ABE_LEFT:
                    area.Left += 2;
                    break;
                case (int)ABEdge.ABE_RIGHT:
                    area.Right -= 2;
                    break;
                case (int)ABEdge.ABE_TOP:
                    area.Top += 2;
                    break;
                case (int)ABEdge.ABE_BOTTOM:
                    area.Bottom -= 2;
                    break;
                default:
                    return area;
            }
            return area;
        }
開發者ID:ControlzEx,項目名稱:ControlzEx,代碼行數:36,代碼來源:WindowChromeWorker.cs

示例8: GetWindowRect

 public static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect);
開發者ID:ForNeVeR,項目名稱:PoshConsole,代碼行數:1,代碼來源:NativeMethods.cs


注:本文中的Standard.RECT類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。