NMCUSTOMDRAW Structure

Contains information specific to an NM_CUSTOMDRAW notification message.

Syntax

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

Members

hdr
An NMHDR structure that contains information about this notification message.
dwDrawStage
The current drawing stage. This is one of the following values.

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.
hdc
A handle to the control's device context. Use this handle to a device context (HDC) to perform any Microsoft Windows Graphics Device Interface (GDI) functions.
rc
The >RECT structure that describes the bounding rectangle of the area being drawn. This member is initialized only by the CDDS_ITEMPREPAINT notification. Version 5.80. This member is also initialized by the CDDS_PREPAINT notification.
dwItemSpec
The item number. What is contained in this member will depend on the type of control that is sending the notification. See the NM_CUSTOMDRAW notification reference for the specific control to determine what, if anything, is contained in this member.
uItemState
The current item state. This value is a combination of the following flags.
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_INDETERMINATE
The item is in an indeterminate state.
CDIS_MARKED
The item is marked. The meaning of this is determined by the implementation.
CDIS_SELECTED
The item is selected.
Note  This flag does not work correctly for owner-drawn list-view controls that have the LVS_SHOWSELALWAYS style. For these controls, you can determine whether an item is selected by using LVM_GETITEMSTATE (or ListView_GetItemState) and checking for the LVIS_SELECTED flag.
CDIS_SHOWKEYBOARDCUES
Version 6.0.The item is a keyboard cue.

Note that Comctl32 version 6 is not redistributable, but it is included with Windows XP or later operating systems. To use Comctl32.dll version 6, specify it in the manifest. For more information on manifests, see Enabling Visual Styles.

CDIS_NEARHOT
The item is part of a control that is currently under the mouse pointer ("hot"), but the item is not "hot" itself. The meaning of this is determined by the implementation.
CDIS_OTHERSIDEHOT
The item is part of a splitbutton that is currently under the mouse pointer ("hot"), but the item is not "hot" itself. The meaning of this is determined by the implementation.
CDIS_DROPHILITED
The item is currently the drop target of a drag-and-drop operation.
lItemlParam
Application-defined item data.

Remarks

The value your application returns depends on the current drawing stage. The dwDrawStage member of the associated NMCUSTOMDRAW structure holds a value that specifies the drawing stage. When the dwDrawStage member equals CDDS_PREPAINT and CDDS_PREERASE, some controls send the CDDS_PREERASE message first and expect the return value to indicate which subsequent messages will be sent. For a code sample that illustrates states and drawing stages, see Customizing a Control's Appearance Using Custom Draw.

Structure Information

Minimum DLL Versioncomctl32.dll version 4.70 or later
Headercommctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0
Tags :


Page view tracker