IntersectRect

  int IntersectRect(lpDestRect, lpSrc1Rect, lpSrc2Rect)    
  LPRECT lpDestRect; /* address of structure for intersection */
  CONST RECT *lpSrc1Rect; /* address of structure with 1st rectangle */
  CONST RECT *lpSrc2Rect; /* address of structure with 2nd rectangle */

This function creates the intersection of two existing rectangles. The intersection is the largest rectangle contained in both rectangles. The IntersectRect function copies the new rectangle to the RECT data structure pointed to by the lpDestRect parameter.

Parameters

lpDestRect

Points to the RECT structure that is to receive the intersection.

lpSrc1Rect

Points to a RECT structure that contains a source rectangle.

lpSrc2Rect

Points to a RECT structure that contains a source rectangle.

Return Value

The return value specifies the intersection of two rectangles. It is TRUE if the intersection of the two rectangles is not empty. It is FALSE if the intersection is empty.