title | description | ms.assetid | keywords | topic_type | api_name | api_location | api_type | ms.topic | ms.date | |||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NM_CUSTOMDRAW (list view) notification code (Commctrl.h) |
Sent by a list-view control to notify its parent windows about drawing operations. This notification code is sent in the form of a WM\_NOTIFY message. |
4e9b91e3-d042-4fd0-b063-a9e6ea9ad564 |
|
|
|
|
|
reference |
05/31/2018 |
Sent by a list-view control to notify its parent windows about drawing operations. This notification code is sent in the form of a WM_NOTIFY message.
NM_CUSTOMDRAW
lpNMCustomDraw = (LPNMLVCUSTOMDRAW) lParam;
-
lParam
-
Pointer to a NMLVCUSTOMDRAW structure that contains information about the drawing operation. The first member of this structure, nmcd, is a pointer to an NMCUSTOMDRAW structure. The dwItemSpec member of the structure pointed to by nmcd contains the identifier of the item being drawn and the lItemlParam member contains its application-defined data.
The value your application can return depends on the current drawing stage. The dwDrawStage member of the associated NMCUSTOMDRAW structure holds a value that specifies the drawing stage. You must return one of the following values.
Return code | Description |
---|---|
|
The control will draw itself. It will not send any additional NM_CUSTOMDRAW notification codes for this paint cycle. This occurs when dwDrawStage equals CDDS_PREPAINT. |
|
Windows Vista. The control will only paint the background. |
|
The control will notify the parent of any item-related drawing operations. It will send NM_CUSTOMDRAW notification codes before and after drawing items. This occurs when dwDrawStage equals CDDS_PREPAINT. |
|
The control will notify the parent after erasing an item. This occurs when dwDrawStage equals CDDS_PREPAINT. |
|
The control will notify the parent after painting an item. This occurs when dwDrawStage equals CDDS_PREPAINT. |
|
The application specified a new font for the item; the control will use the new font. For more information about changing fonts, see Changing fonts and colors. This occurs when dwDrawStage equals CDDS_ITEMPREPAINT. |
|
Version 4.71. Your application will receive an NM_CUSTOMDRAW control code with dwDrawStage set to CDDS_ITEMPREPAINT | CDDS_SUBITEM before each list-view subitem is drawn. You can then specify font and color for each subitem separately or return CDRF_DODEFAULT for default processing. This occurs when dwDrawStage equals CDDS_ITEMPREPAINT. |
|
The application drew the item manually. The control will not draw the item. This occurs when dwDrawStage equals CDDS_ITEMPREPAINT. |
|
Windows Vista. The control will not draw the focus rectangle. |
Version 5.80. If you change the font by returning CDRF_NEWFONT, the list-view control might display clipped text. This behavior is necessary for backward compatibility with earlier versions of the common controls. If you want to change the font of a list-view control, you will get better results if you send a CCM_SETVERSION message with the wParam value set to 5 before adding any items to the control.
Requirement | Value |
---|---|
Minimum supported client |
Windows Vista [desktop apps only] |
Minimum supported server |
Windows Server 2003 [desktop apps only] |
Header |
|