NMCUSTOMDRAW

This structure contains information specific to an NM_CUSTOMDRAW notification message.

At a Glance

Header file: Commctrl.h
Windows CE versions: 2.0 and later

Syntax

typedef struct tagNMCUSTOMDRAWINFO {
NMHDR hdr;
DWORD dwDrawStage;
HDC hdc;
RECT rc;
DWORD dwItemSpec;
UINT uItemState;
LPARAM lItemlParam;
}
NMCUSTOMDRAW, FAR * LPNMCUSTOMDRAW;

Members

hdr

Handle to a NMHDR structure that contains information about this notification message.

dwDrawStage

Specifies the current drawing stage. It is one of the following values.

Global Drawstage values:

Value Description
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 Drawstage values:

Value Description
CDDS_ITEM Indicates that the dwItemSpec, uItemState, and lItemParam 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

hdc

Handle to the control’s device context. Use this HDC to perform any GDI functions.

rc

RECT structure that describes the bounding rectangle of the area being drawn.

dwItemSpec

Specifies the item number. This value is control specific, using the item-referencing convention for that control. Additionally, trackbar controls use the following values to identify portions of control:

Value Description
TBCD_CHANNEL Identifies the channel that the trackbar control’s thumb marker slides along.
TBCD_THUMB Identifies the trackbar control’s thumb marker. This is the portion of the control that the user moves.
TBCD_TICS Identifies the increment tic marks that appear along the edge of the trackbar control.

uItemState

Specifies the current item state. It can be a combination of the following values:

Value Description
CDIS_CHECKED The item is checked.
CDIS_DEFAULT The item is in its default state.
CDIS_DISABLED The item is disabled.
CDIS_FOCUS The item is in focus.
CDIS_GRAYED The item is grayed.
CDIS_HOT The item is currently under the pointer (“hot”).
CDIS_SELECTED The item is selected.

lItemlParam

Application-defined item data.