Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Contains information specific to an NM_CUSTOMDRAW notification code.
Syntax
typedef struct tagNMCUSTOMDRAWINFO {
NMHDR hdr;
DWORD dwDrawStage;
HDC hdc;
RECT rc;
DWORD_PTR dwItemSpec;
UINT uItemState;
LPARAM lItemlParam;
} NMCUSTOMDRAW, *LPNMCUSTOMDRAW;
Members
hdr
Type: NMHDR
An NMHDR structure that contains information about this notification code.
dwDrawStage
Type: DWORD
The current drawing stage. This is one of the following values.
Value | Meaning |
---|---|
|
|
|
After the erasing cycle is complete. |
|
After the painting cycle is complete. |
|
Before the erasing cycle begins. |
|
Before the painting cycle begins. |
|
|
|
Indicates that the dwItemSpec, uItemState, and lItemlParam members are valid. |
|
After an item has been erased. |
|
After an item has been drawn. |
|
Before an item is erased. |
|
Before an item is drawn. |
|
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
Type: HDC
A handle to the control's device context. Use this HDC to perform any GDI functions.
rc
Type: RECT
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
Type: DWORD_PTR
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
Type: UINT
The current item state. This value is a combination of the following flags.
Value | Meaning |
---|---|
|
The item is checked. |
|
The item is in its default state. |
|
The item is disabled. |
|
The item is in focus. |
|
The item is grayed. |
|
The item is currently under the pointer ("hot"). |
|
The item is in an indeterminate state. |
|
The item is marked. The meaning of this is determined by the implementation. |
|
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.
|
|
Version 6.0.The item is showing its keyboard cues. Note that Comctl32 version 6 is not redistributable. operating systems. To use Comctl32.dll version 6, specify it in the manifest. For more information on manifests, see Enabling Visual Styles. |
|
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. |
|
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. |
|
The item is currently the drop target of a drag-and-drop operation. |
lItemlParam
Type: LPARAM
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.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Header | commctrl.h |