当前位置: 首页>>代码示例>>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;未经允许,请勿转载。