本文整理汇总了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);
示例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;
}
示例3: CreateRectRgnIndirect
public static IntPtr CreateRectRgnIndirect(RECT lprc)
{
IntPtr ret = _CreateRectRgnIndirect(ref lprc);
if (IntPtr.Zero == ret)
{
throw new Win32Exception();
}
return ret;
}
示例4: _AdjustWindowRectEx
private static extern bool _AdjustWindowRectEx(ref RECT lpRect, WS dwStyle, [MarshalAs(UnmanagedType.Bool)] bool bMenu, WS_EX dwExStyle);
示例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),
};
}
示例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);
}
示例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;
}
示例8: GetWindowRect
public static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect);