OffsetRect

2.x

  void OffsetRect(lprc, x, y)    
  RECT FAR* lprc; /* address of structure with rectangle */
  int x; /* horizontal offset, */  
  int y; /* vertical offset */

The OffsetRect function moves the given rectangle by the specified offsets.

Parameters

lprc

Points to a RECT structure that contains the coordinates of the rectangle to be moved. The RECT structure has the following form:

typedef struct tagRECT {    /* rc */
   int left;
   int top;
   int right;
   int bottom;
} RECT;

For a full description of this structure, see the Microsoft Windows Programmer's Reference, Volume 3.

x

Specifies the amount to move left or right. It must be negative to move left.

y

Specifies the amount to move up or down. It must be negative to move up.

Return Value

This function does not return a value.

Comments

The coordinate values of a rectangle must not be greater than 32,767 or less than
–32,768. The x and y parameters must be chosen carefully to prevent invalid
rectangles.

See Also

InflateRect, IntersectRect, UnionRect