Custom Draw services allow the custom to draw the control on his own, which provide by many common controls. As follows:
Header controls
List-view controls
Rebar controls
Toolbar controls
ToolTip controls
Trackbar controls
Tree-view controls
It allow an application greater flexibility in customizing a control's appearence. The control that support custom draw send NM_CUSTOMDRAW notification message to its parent window about drawing operations. Like many notification messages, NM_CUSTOMDRAW notification are sent as WM_NOTIFY message.
The lParam parameter of a custom draw notification message will be the address of an NMCUSTOMDRAW structure or a control-specific structure that contains an NMCUSTOMDRAW structure as its first member.
The current stage of the paint cycle(the process of a control painting or erasing itself is called a paint cycle) is referred to as the drawstage member in the NMCUSTOMDRAW structure.
Current drawing stage. This value is one of the following.
Global Values:
CDDS_POSTERASE
After the erasing cycle is complete.
CDDS_POSTPAINT
After the painting cycle is complete.
CDDS_PREERASE
Before the erasing cycle begins.
CDDS_PREPAINT
Before the painting cycle begins.
Item-specific Values:
CDDS_ITEM
Indicates that the dwItemSpec, uItemState, and lItemlParam members are valid.
CDDS_ITEMPOSTERASE
After an item has been erased.
CDDS_ITEMPOSTPAINT
After an item has been drawn.
CDDS_ITEMPREERASE
Before an item is erased.
CDDS_ITEMPREPAINT
Before an item is drawn.
CDDS_SUBITEM
Version 4.71. Flag combined with CDDS_ITEMPREPAINT or CDDS_ITEMPOSTPAINT if a subitem is being drawn. This will only be set if CDRF_NOTIFYITEMDRAW is returned from CDDS_PREPAINT.
Your application must process the NM_CUSTOMDRAW notification message and then return a specific value depends on the current drawing stage to inform the control what it must do.
the return values are:
CDRF_DODEFAULT
CDRF_NOTIFYITEMDRAW
CDRF_NOTIFYITEMERASE
CDRF_NOTIFYPOSTERASE
CDRF_NOTIFYPOSTPAINT
CDRF_NEWFONT
CDRF_NOTIFYSUBITEMDRAW
CDRF_SKIPDEFAULT
(seeing details,please refer to the MSDN)
Header controls
List-view controls
Rebar controls
Toolbar controls
ToolTip controls
Trackbar controls
Tree-view controls
It allow an application greater flexibility in customizing a control's appearence. The control that support custom draw send NM_CUSTOMDRAW notification message to its parent window about drawing operations. Like many notification messages, NM_CUSTOMDRAW notification are sent as WM_NOTIFY message.
The lParam parameter of a custom draw notification message will be the address of an NMCUSTOMDRAW structure or a control-specific structure that contains an NMCUSTOMDRAW structure as its first member.
The current stage of the paint cycle(the process of a control painting or erasing itself is called a paint cycle) is referred to as the drawstage member in the NMCUSTOMDRAW structure.
Current drawing stage. This value is one of the following.
Global Values:
CDDS_POSTERASE
After the erasing cycle is complete.
CDDS_POSTPAINT
After the painting cycle is complete.
CDDS_PREERASE
Before the erasing cycle begins.
CDDS_PREPAINT
Before the painting cycle begins.
Item-specific Values:
CDDS_ITEM
Indicates that the dwItemSpec, uItemState, and lItemlParam members are valid.
CDDS_ITEMPOSTERASE
After an item has been erased.
CDDS_ITEMPOSTPAINT
After an item has been drawn.
CDDS_ITEMPREERASE
Before an item is erased.
CDDS_ITEMPREPAINT
Before an item is drawn.
CDDS_SUBITEM
Version 4.71. Flag combined with CDDS_ITEMPREPAINT or CDDS_ITEMPOSTPAINT if a subitem is being drawn. This will only be set if CDRF_NOTIFYITEMDRAW is returned from CDDS_PREPAINT.
Your application must process the NM_CUSTOMDRAW notification message and then return a specific value depends on the current drawing stage to inform the control what it must do.
the return values are:
CDRF_DODEFAULT
CDRF_NOTIFYITEMDRAW
CDRF_NOTIFYITEMERASE
CDRF_NOTIFYPOSTERASE
CDRF_NOTIFYPOSTPAINT
CDRF_NEWFONT
CDRF_NOTIFYSUBITEMDRAW
CDRF_SKIPDEFAULT
(seeing details,please refer to the MSDN)