public void RectRegularTest() { RECT rect = new RECT(100, 100, 200, 200); Assert.AreEqual(100, rect.left); Assert.AreEqual(100, rect.top); Assert.AreEqual(200, rect.right); Assert.AreEqual(200, rect.bottom); Rectangle rectangle = Rectangle.FromLTRB(rect.left, rect.top, rect.right, rect.bottom); Assert.AreEqual(rectangle.Location, rect.Location); Assert.AreEqual(rectangle.Size, rect.Size); rect.right = 100; rect.bottom = 100; rectangle = Rectangle.FromLTRB(rect.left, rect.top, rect.right, rect.bottom); Assert.AreEqual(rectangle.Location, rect.Location); Assert.AreEqual(rectangle.Size, rect.Size); rect.right = 50; rect.bottom = 50; rectangle = Rectangle.FromLTRB(rect.left, rect.top, rect.right, rect.bottom); Assert.AreEqual(rectangle.Location, rect.Location); Assert.AreEqual(rectangle.Size, rect.Size); }
public void RectEqualityTest() { RECT rect = new RECT(100, 100, 300, 300); RECT rect2 = new RECT(100, 100, 300, 300); Rectangle rect3 = new Rectangle(100, 100, 200, 200); Assert.AreEqual(rect, rect2); Assert.AreEqual(rect, rect3); Rectangle rect4 = new Rectangle(200, 200, 200, 200); RECT rect5 = new RECT(200, 300, 400, 500); Assert.AreNotEqual(rect, rect4); Assert.AreNotEqual(rect, rect5); }
public static extern IntPtr SendMessage(IntPtr hWnd, Int32 msg, IntPtr wParam, ref RECT lParam);
public static extern Boolean RedrawWindow(IntPtr hWnd, ref RECT lprcUpdate, IntPtr hrgnUpdate, Int32 flags);
public static extern Boolean InvalidateRect(IntPtr hWnd, ref RECT lpRect, [MarshalAs(UnmanagedType.Bool)] Boolean bErase);
public static extern Boolean AdjustWindowRectEx(ref RECT rect, Int32 dwStyle, [MarshalAs(UnmanagedType.Bool)] Boolean bMenu, Int32 dwExStyle);
public static extern Boolean GetWindowRect(IntPtr hWnd, ref RECT lpRect);
public static extern bool AdjustWindowRectEx(ref RECT rect, int dwStyle, bool bMenu, int dwExStyle);
public static extern bool InvalidateRect(IntPtr hWnd, ref RECT lpRect, bool bErase);