最近在学习《WTL for MFC Programmer》系列文章的一些小结和感受
相同点:
1.都是通知消息,都可以被反射回控件类自行处理。
2.都和自定义控件的绘画有关。
区别:
MSDN对WM_DRAWITEM描述:
The WM_DRAWITEM message is sent to the parent window of an owner-drawn button, combo box, list box, or menu when a visual aspect of the button, combo box, list box, or menu has changed.
MSDN对NM_CUSTOMDRAW的描述:
Sent by some common controls to notify their parent windows about drawing operations. This notification is sent in the form of a WM_NOTIFY message.
1.可以看出,前者是对Owner-Draw风格的按钮,复选框,列表框和菜单有效的,树形控件并没在此列。所以在系列文章的第五篇中,自定义按钮是继承了COwnerDraw,树形控件是继承了CCustomDraw,MSDN中也列出了一些NM_CUSTOMDRAW有关的控件:
List view
NMLVCUSTOMDRAW
ToolTip
NMTTCUSTOMDRAW
Tree view
NMTVCUSTOMDRAW
Toolbar
NMTBCUSTOMDRAW
All other supported c