This function draws a frame control of the specified type and style.
At a Glance
Header file: | Winuser.h |
Windows CE versions: | 2.0 and later |
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 RECT structure 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 uType is DFC_BUTTON, uState can 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 uType is DFC_CAPTION, uState can be one of the following values.
Value | Description |
DFCS_CAPTIONCLOSE | Close button |
DFCS_CAPTIONHELP | Help button |
DFCS_CAPTIONOKBTN | OK button |
If uType is DFC_MENU, uState can be one of the following values.
Value | Description |
DFCS_MENUARROW | Submenu arrow |
DFCS_MENUARROWRIGHT | Submenu arrow pointing left. This is used for the right-to-left cascading menus used with right-to-left languages such as Arabic or Hebrew. |
DFCS_MENUBULLET | Bullet |
DFCS_MENUCHECK | Check mark |
If uType is DFC_SCROLL, uState can 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 |
The following style can be used to adjust the bounding rectangle of the push button.
Value | Description |
DFCS_ADJUSTRECT | Bounding rectangle is adjusted to exclude the surrounding edge of the push button. |
One or more of the following values can be used to set the state of the control to be drawn.
Value | Description |
DFCS_CHECKED | Button is checked. |
DFCS_INACTIVE | Button is inactive (grayed). |
DFCS_PUSHED | Button is pushed. |
Return Values
Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.
Remarks
If uType is DFC_BUTTON and uState is 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 hbmMask parameter to the MaskBlt function, or it can use the device context as a parameter to the BitBlt function using ROPs such as SRCAND and SRCINVERT.
See Also