Declare Function UnionRect Lib "user32.dll" (lpDestRect As RECT, lpSrc1Rect As RECT, lpSrc2Rect As RECT) As Long
lpDestRect
.lpDestRect | Receives the coordinates of the union rectangle. |
lpSrc1Rect | One of the rectangles that determine the union rectangle. |
lpSrc2Rect | The other rectangle that determines the union rectangle. |
's1.Left = 50, .Top = .50, .Right = 150, .Bottom = 150
's2.Left = 100, .Top = 100, .Right = 200, .Bottom = 200
Dim union As RECT, s1 As RECT, s2 As RECT
x = SetRect(s1, 50, 50, 150, 150) 'API function sets the rectangle
x = SetRect(s2, 100, 100, 200, 200)
x = UnionRect(union, s1, s2)
'Now, union.Left = 50, .Top = 50, .Right = 200, .Bottom = 200
Paul Kuliniewicz
E-mail: Borg953@aol.com
All material presented on these pages is Copyright © Paul Kuliniewicz, except for other copyrighted material.
http://members.aol.com/Borg953/api/u.html