Exemplo n.º 1
0
		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);
		}
Exemplo n.º 2
0
		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);
		}
Exemplo n.º 3
0
		public static extern IntPtr SendMessage(IntPtr hWnd, Int32 msg, IntPtr wParam, ref RECT lParam);
Exemplo n.º 4
0
		public static extern Boolean RedrawWindow(IntPtr hWnd, ref RECT lprcUpdate, IntPtr hrgnUpdate, Int32 flags);
Exemplo n.º 5
0
		public static extern Boolean InvalidateRect(IntPtr hWnd, ref RECT lpRect, [MarshalAs(UnmanagedType.Bool)] Boolean bErase);
Exemplo n.º 6
0
		public static extern Boolean AdjustWindowRectEx(ref RECT rect, Int32 dwStyle, [MarshalAs(UnmanagedType.Bool)] Boolean bMenu, Int32 dwExStyle);
Exemplo n.º 7
0
		public static extern Boolean GetWindowRect(IntPtr hWnd, ref RECT lpRect);
Exemplo n.º 8
0
		public static extern bool AdjustWindowRectEx(ref RECT rect, int dwStyle, bool bMenu, int dwExStyle);
Exemplo n.º 9
0
		public static extern bool InvalidateRect(IntPtr hWnd, ref RECT lpRect, bool bErase);