OffsetRect

Syntax

void OffsetRect(lpRect,X,Y)

This function moves the given rectangle by the specified offsets. The OffsetRect function moves the rectangle X units along the x-axis and Y units along the y-axis. The X and Y parameters are signed values, so the rectangle can be moved left or right, and up or down.

Parameter Type/Description  

lpRect LPRECT Points to a RECT data structure that contains the rectangle to be moved.  
X int Specifies the amount to move left or right. It must be negative to move left.  
Y int Specifies the amount to move up or down. It must be negative to move up.  

Return Value

None.

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.