FrameRect function

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(
  HDC        hDC,
  const RECT *lprc,
  HBRUSH     hbr
);

Parameters

hDC

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

lprc

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

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

   
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

See Also

CreateHatchBrush

CreatePatternBrush

CreateSolidBrush

Filled Shape Functions

Filled Shapes Overview

GetStockObject

RECT