Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
UnionRect

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(
  _Out_       LPRECT lprcDst,
  _In_  const RECT   *lprcSrc1,
  _In_  const RECT   *lprcSrc2
);

Parameters

lprcDst [out]

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

lprcSrc1 [in]

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

lprcSrc2 [in]

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]

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

Rectangles Overview
Rectangle Functions
InflateRect
IntersectRect
OffsetRect
RECT

 

 

Community Additions

ADD
Show:
© 2015 Microsoft