Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
SubtractRect
CRect                                       Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  Windows 3.1 only
 
  BOOL SubtractRect( LPRECT lpRectSrc1, LPRECT lpRectSrc2 );
 
  Parameter    Description
 
  <lpRectSrc1> Points to the RECT structure from which a rectangle is to
               be subtracted.
 
  <lpRectSrc2> Points to the RECT structure that is to be subtracted from
               the rectangle pointed to by <lpRectSrc1>.
 
  Remarks
 
  Makes the dimensions of a CRect object equal to the subtraction of
  <lpRectSrc2> from <lpRectSrc1>.
 
  The rectangle specified by <lpRectSrc2> is subtracted from the rectangle
  specified by <lpRectSrc1> only when the rectangles intersect completely
  in either the x- or y-direction.
 
  For example, if <lpRectSrc1> were (10,10, 100,100) and <lpRectSrc2> were
  (50,50, 150,150), the rectangle pointed to by <lpRectSrc1> would contain
  the same coordinates as the original <lpRectSrc1> when the function
  returned. If <lpRectSrc1> were (10,10, 100,100) and <lpRectSrc2> were
  (50,10, 150,150), however, the rectangle pointed to by <lpRectSrc1>
  would contain the coordinates (10,10, 50,100) when the function
  returned.
 
  Return Value
 
  Nonzero if the function is successful; otherwise, 0.
 
  See Also
 
  CRect::IntersectRect, ::UnionRect, ::SubtractRect
 
 
                                     -♦-