Export (0) Print
Expand All

SetRect function

The SetRect function sets the coordinates of the specified rectangle. This is equivalent to assigning the left, top, right, and bottom arguments to the appropriate members of the RECT structure.

Syntax


BOOL SetRect(
  _Out_  LPRECT lprc,
  _In_   int xLeft,
  _In_   int yTop,
  _In_   int xRight,
  _In_   int yBottom
);

Parameters

lprc [out]

Pointer to the RECT structure that contains the rectangle to be set.

xLeft [in]

Specifies the x-coordinate of the rectangle's upper-left corner.

yTop [in]

Specifies the y-coordinate of the rectangle's upper-left corner.

xRight [in]

Specifies the x-coordinate of the rectangle's lower-right corner.

yBottom [in]

Specifies the y-coordinate of the rectangle's lower-right corner.

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 [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

Rectangles Overview
Rectangle Functions
CopyRect
SetRectEmpty
RECT

 

 

Community Additions

ADD
Show:
© 2014 Microsoft