IntersectRect

This function calculates the intersection of two source rectangles and places the coordinates of the intersection rectangle into the destination rectangle. If the source rectangles do not intersect, an empty rectangle (in which all coordinates are set to zero) is placed into the destination rectangle.

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

Parameters

  • lprcDst
    Long pointer to the RECT structure that is to receive the intersection of the rectangles pointed to by the lprcSrc1 and lprcSrc2 parameters.
  • lprcSrc1
    Long pointer to the RECT structure that contains the first source rectangle.
  • lprcSrc2
    Long pointer to the RECT structure that contains the second source rectangle.

Return Values

Nonzero indicates that the rectangles intersect. Zero indicates that the rectangles do not intersect.

To get extended error information, call GetLastError.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later Winuser.h   Rectapi.lib

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

GetLastError, InflateRect, OffsetRect, UnionRect, RECT

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.