This topic has not yet been rated - Rate this topic

OffsetRect function

Applies to: desktop apps only

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

Syntax

BOOL OffsetRect(
  __inout  LPRECT lprc,
  __in     int dx,
  __in     int dy
);

Parameters

lprc [in, out]

Pointer to a RECT structure that contains the logical coordinates of the rectangle to be moved.

dx [in]

Specifies the amount to move the rectangle left or right. This parameter must be a negative value to move the rectangle to the left.

dy [in]

Specifies the amount to move the rectangle up or down. This parameter must be a negative value to move the rectangle up.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Remarks

Because applications can use rectangles for different purposes, the rectangle functions do not use an explicit unit of measure. Instead, all rectangle coordinates and dimensions are given in signed, logical values. The mapping mode and the function in which the rectangle is used determine the units of measure.

Examples

For an example, see Using Rectangles.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

Rectangles Overview
Rectangle Functions
InflateRect
IntersectRect
UnionRect
RECT

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ