FrameRect function (winuser.h)

The FrameRect function draws a border around the specified rectangle by using the specified brush. The width and height of the border are always one logical unit.

Syntax

int FrameRect(
  [in] HDC        hDC,
  [in] const RECT *lprc,
  [in] HBRUSH     hbr
);

Parameters

[in] hDC

A handle to the device context in which the border is drawn.

[in] lprc

A pointer to a RECT structure that contains the logical coordinates of the upper-left and lower-right corners of the rectangle.

[in] hbr

A handle to the brush used to draw the border.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Remarks

The brush identified by the hbr parameter must have been created by using the CreateHatchBrush, CreatePatternBrush, or CreateSolidBrush function, or retrieved by using the GetStockObject function.

If the bottom member of the RECT structure is less than the top member, or if the right member is less than the left member, the function does not draw the rectangle.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll
API set ext-ms-win-ntuser-gui-l1-1-1 (introduced in Windows 8.1)

See also

CreateHatchBrush

CreatePatternBrush

CreateSolidBrush

Filled Shape Functions

Filled Shapes Overview

GetStockObject

RECT