UnionRect

Syntax

int UnionRect(lpDestRect,lpSrc1Rect,lpSrc2Rect)

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

Parameter Type/Description  

lpDestRect LPRECT Points to the RECT data structure that is to receive the new union.  
lpSrc1Rect LPRECT Points to a RECT data structure that contains a source rectangle.  
lpSrc2Rect LPRECT Points to a RECT data structure that contains a source rectangle.  

Return Value

The return value specifies the outcome of the function. It is nonzero if the union is not empty. It is zero if the union is empty.

Comments

Windows ignores the dimensions of an “empty” rectangle, that is, a rectangle that has no height or has no width.