UnionRect function

The UnionRect function creates the union of two rectangles. The union is the smallest rectangle that contains both source rectangles.

Syntax

BOOL UnionRect(
  LPRECT     lprcDst,
  const RECT *lprcSrc1,
  const RECT *lprcSrc2
);

Parameters

lprcDst

A pointer to the RECT structure that will receive a rectangle containing the rectangles pointed to by the lprcSrc1 and lprcSrc2 parameters.

lprcSrc1

A pointer to the RECT structure that contains the first source rectangle.

lprcSrc2

A pointer to the RECT structure that contains the second source rectangle.

Return Value

If the specified structure contains a nonempty rectangle, the return value is nonzero.

If the specified structure does not contain a nonempty rectangle, the return value is zero.

Remarks

The system ignores the dimensions of an empty rectangle that is, a rectangle in which all coordinates are set to zero, so that it has no height or no width.

Because applications can use rectangles for different purposes, the rectangle functions do not use an explicit unit of measure. Instead, all rectangle coordinates and dimensions are given in signed, logical values. The mapping mode and the function in which the rectangle is used determine the units of measure.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll

See Also

InflateRect

IntersectRect

OffsetRect

RECT

Rectangle Functions

Rectangles Overview