CDC::DrawFrameControl

BOOL DrawFrameControl( LPRECT lpRect, UINT nType, UINT nState );

Return Value

Nonzero if successful; otherwise 0.

Parameters

lpRect

A pointer to a RECT structure that contains the logical coordinates of the rectangle.

nType

Specifies the type of frame control to draw. This parameter can be one of the following values:

nState

Specifies the initial state of the frame control. See the Remarks section for a table of the parameter’s values:

Remarks

Call this member function to draw a frame control of the specified type and style.

Use the nState value DFCS_ADJUSTRECT to adjust  the bounding rectangle 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:

In several cases, nState depends on the nType parameter. The following list shows the relationship between the four nType values and nState:

For more information about the Windows API DrawFrameControl, see ::DrawFrameControl in the Win32 SDK Programmer’s Reference.

Example

This code draws the size gripper in the bottom-right corner of your window. It's appropriate for the OnPaint handler of a dialog box, which has no styles and normally doesn't contain other controls (like a status bar) that may give it a size gripper.

CRect rc;
GetClientRect(&rc);

rc.left = rc.right - ::GetSystemMetrics(SM_CXHSCROLL);
rc.top = rc.bottom - ::GetSystemMetrics(SM_CYVSCROLL);

dc.DrawFrameControl(rc, DFC_SCROLL, DFCS_SCROLLSIZEGRIP);

CDC OverviewClass MembersHierarchy Chart

See Also   ::DrawFrameControl