FrameRect

2.x

  int FrameRect(hdc, lprc, hbr)    
  HDC hdc; /* handle of device context */
  const RECT FAR* lprc; /* address of structure with rectangle */
  HBRUSH hbr; /* handle of brush, */  

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

Parameters

hdc

Identifies the device context in which to draw the border.

lprc

Points to a RECT structure that contains the logical coordinates of the upper-left and lower-right corners of the rectangle. The RECT structure has the following form:

typedef struct tagRECT {    /* rc */
   int left;
   int top;
   int right;
   int bottom;
} RECT;

For a full description of this structure, see the Microsoft Windows Programmer's Reference, Volume 3.

hbr

Identifies the brush that will be used to draw the border.

Return Value

The return value is not used and has no meaning.

Comments

The border drawn by the FrameRect function is in the same position as a border drawn by the Rectangle function using the same coordinates (if Rectangle uses a pen that is one logical unit wide). The interior of the rectangle is not filled when an application calls FrameRect.

FrameRect compares the values of the top, bottom, left, and right members of the specified RECT structure. If bottom is less than or equal to top, or if right is less than or equal to left, FrameRect does not draw the rectangle.

See Also

CreateHatchBrush, CreatePatternBrush, CreateSolidBrush, DrawFocusRect