NM_CUSTOMDRAW (Windows CE 5.0)

Send Feedback

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

NM_CUSTOMDRAW#ifdef LIST_VIEW_CUSTOM_DRAWlpNMCustomDraw = (LPNMLVCUSTOMDRAW) lParam;#elif TOOL_TIPS_CUSTOM_DRAWlpNMCustomDraw = (LPNMTTCUSTOMDRAW) lParam;#elif TREE_VIEW_CUSTOM_DRAWlpNMCustomDraw = (LPNMTVCUSTOMDRAW) lParam;#elselpNMCustomDraw = (LPNMCUSTOMDRAW) lParam;#endif

Parameters

  • lpNMCustomDraw
    Long pointer to a custom draw-related structure that contains information about the drawing operation. The following table lists the controls that send the NM_CUSTOMDRAW message and their associated structures.
    Control Structure
    List view NMLVCUSTOMDRAW
    ToolTips NMTTCUSTOMDRAW
    Tree view NMTVCUSTOMDRAW
    All other supported controls NMCUSTOMDRAW

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 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 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.

You must return one of the following values 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, ToolTip, trackbar, and tree view controls support custom draw functionality. The ToolTip control supports custom draw for Microsoft® Windows® CE.

Requirements

OS Versions: Windows CE 2.0 and later.
Header: Commctrl.h.

See Also

WM_NOTIFY | NMCUSTOMDRAW | NMLVCUSTOMDRAW

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.