NM_CUSTOMDRAW

This notification message is sent by some common controls to notify their parent windows about drawing operations. It is sent in the form of a WM_NOTIFY message.

#ifdef LIST_VIEW_CUSTOM_DRAW
lpNMCustomDraw = (LPNMLVCUSTOMDRAW) lParam;
#elif TREE_VIEW_CUSTOM_DRAW
lpNMCustomDraw = (LPNMTVCUSTOMDRAW) lParam;
#else
lpNMCustomDraw = (LPNMCUSTOMDRAW) lParam;
#endif

Parameters

  • lpNMCustomDraw
    Long pointer to a Custom Draw-related structure that contains information about the drawing operation. List view controls use the NMLVCUSTOMDRAW structure, and all other supported controls use the NMCUSTOMDRAW structure.

Return Values

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.

When dwDrawStage equals CDDS_PREPAINT:

  • CDRF_DODEFAULT
    The control will draw itself. It will not send any additional NM_CUSTOMDRAW messages for this paint cycle.
  • CDRF_NOTIFYITEMDRAW
    The control will notify the parent of any item-related drawing operations. It will send NM_CUSTOMDRAW notification messages before and after drawing items.
  • CDRF_NOTIFYITEMERASE
    The control will notify the parent when an item will be erased. It will send NM_CUSTOMDRAW notification messages before and after erasing items.
  • CDRF_NOTIFYPOSTERASE
    The control will notify the parent after erasing an item.
  • CDRF_NOTIFYPOSTPAINT
    The control will notify the parent after painting an item.

When dwDrawStage equals CDDS_ITEMPREPAINT:

  • CDRF_NEWFONT
    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.
  • CDRF_SKIPDEFAULT
    Your application drew the item manually. The control will not draw the item.

Remarks

Currently header, list view, rebar, toolbar, trackbar, and tree view controls support Custom Draw functionality.

Requirements

Runs On Versions Defined in Include Link to
Windows CE OS 2.0 and later Commctrl.h    

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

WM_NOTIFY, NMCUSTOMDRAW, NMLVCUSTOMDRAW

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.