Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Sent by a tree-view control to notify its parent window about drawing operations. This notification code is sent in the form of a WM_NOTIFY message.
NM_CUSTOMDRAW
lpNMCustomDraw = (LPNMTVCUSTOMDRAW) lParam;
lParam
Pointer to an NMTVCUSTOMDRAW structure that contains and receives information about the drawing operation. The dwItemSpec member of the nmcd member of this structure contains the handle of the item being drawn. The lItemlParam member of the nmcd member of this structure contains the lParam of the item being drawn.
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 draws itself. It does not send any additional NM_CUSTOMDRAW codes for this paint cycle. This occurs when dwDrawStage equals CDDS_PREPAINT. |
|
The control notifies the parent of any item-related drawing operations. It sends NM_CUSTOMDRAW notification codes before and after drawing items. This occurs when dwDrawStage equals CDDS_PREPAINT. |
|
The control notifies the parent after erasing an item.This occurs when dwDrawStage equals CDDS_PREPAINT. |
|
The control notifies the parent after painting an item. This occurs when dwDrawStage equals CDDS_PREPAINT. |
|
Version 4.71. The control notifies the parent when a list-view subitem is being drawn. This occurs when dwDrawStage equals CDDS_PREPAINT. |
|
Your application specified a new font for the item; the control will use the new font. For more information on changing fonts, see Changing fonts and colors. This occurs when dwDrawStage equals CDDS_ITEMPREPAINT. |
|
Your application drew the item manually. The control will not draw the item. This occurs when dwDrawStage equals CDDS_ITEMPREPAINT. |
Version 5.80. If you change the font by returning CDRF_NEWFONT, the tree-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 tree-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 |
|
Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register today