CRect类成员函数
BOOL IntersertRect ( LPCRECT lpRect1, LPCRECT lpRect2 );
返回值:如果交不为空,则返回非零值;否则,如果交为空则返回0

解决方案 »

  1.   

    BOOL IntersectRect( LPCRECT lpRect1, LPCRECT lpRect2 );Return ValueNonzero if the intersection is not empty; 0 if the intersection is empty.
      

  2.   

    IntersectRect
    The IntersectRect 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,        // intersection buffer
      CONST RECT *lprcSrc1,  // first rectangle
      CONST RECT *lprcSrc2   // second rectangle
    );
    Parameters
    lprcDst 
    [out] Pointer to the RECT structure that is to receive the intersection of the rectangles pointed to by the lprcSrc1 and lprcSrc2 parameters. This parameter cannot be NULL. 
    lprcSrc1 
    [in] Pointer to the RECT structure that contains the first source rectangle. 
    lprcSrc2 
    [in] Pointer to the RECT structure that contains the second source rectangle.