Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function draws a frame control of the specified type and style.

Syntax

BOOL DrawFrameControl( 
  HDC 
hdc, 
  LPRECT 
lprc, 
  UINT 
uType, 
  UINT 
uState
); 

Parameters

hdc

Handle to the device context of the window in which to draw the control.

lprc

Long pointer to a RECTstructure that contains the logical coordinates of the bounding rectangle for frame control.

uType

Specifies the type of frame control to draw.

This parameter can be one of the following values.

Value Description

DFC_BUTTON

Standard button

DFC_CAPTION

Title bar

DFC_SCROLL

Scroll bar

uState

Specifies the initial state of the frame control.

If uTypeis DFC_BUTTON, uStatecan be one of the following values.

Value Description

DFCS_BUTTON3STATE

Three-state button

DFCS_BUTTONCHECK

Check box

DFCS_BUTTONPUSH

Push button

DFCS_BUTTONRADIO

Radio button

If uTypeis DFC_CAPTION, uStatecan be one of the following values.

Value Description

DFCS_CAPTIONCLOSE

Close button

DFCS_CAPTIONHELP

Help button

DFCS_CAPTIONOKBTN

OK button

If uTypeis DFC_SCROLL, uStatecan be one of the following values.

Value Description

DFCS_SCROLLCOMBOBOX

Combo box scroll bar

DFCS_SCROLLDOWN

Down arrow of scroll bar

DFCS_SCROLLLEFT

Left arrow of scroll bar

DFCS_SCROLLRIGHT

Right arrow of scroll bar

DFCS_SCROLLUP

Up arrow of scroll bar

One or more of the following values can be used to set the state of the control to be drawn.

Value Description

DFCS_CHECKED

The button is checked.

DFCS_INACTIVE

The button does not accept user input.

DFCS_PUSHED

The button is pushed.

Return Value

Nonzero indicates success.

Zero indicates failure.

To get extended error information, call GetLastError.

Remarks

If uTypeis DFC_BUTTON and uStateis not DFCS_BUTTONPUSH, the frame control is a black-on-white mask (that is, a black frame control on a white background).

In such cases, the application must pass a handle to a bitmap memory device control. The application can then use the associated bitmap as the hbmMaskparameter to the MaskBltfunction, or it can use the device context as a parameter to the BitBltfunction using ROPs such as SRCAND and SRCINVERT.

Requirements

Header winuser.h
Library Nclient.lib
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

BitBlt
MaskBlt
RECT