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.
Notifies the parent window of a button control about custom draw operations on the button.
The button control sends this notification code in the form of a WM_NOTIFY message.
NM_CUSTOMDRAW
lpNMCustomDraw = (LPNMCUSTOMDRAW) lParam;
lParam
A pointer to an NMCUSTOMDRAW structure that contains information about the drawing operation. The dwItemSpec member of this structure contains the index of the item being drawn and the lItemlParam member of this structure contains the item's lParam.
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 notify the parent after erasing an item. This can be used only if dwDrawStage equals CDDS_PREERASE. |
|
The control will notify the parent after painting an item. This can be used only if dwDrawStage equals CDDS_PREPAINT. |
|
The application drew the item manually. The control will not draw the item. This can be used when dwDrawStage equals CDDS_PREERASE or CDDS_PREPAINT. |
If the button control is marked ownerdraw (BS_OWNERDRAW), the NM_CUSTOMDRAW notification code is not sent.
See Using Custom Draw for further discussion.
Note
To use this notification code, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
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