有谁知道PreSubclassWindow消息和DrawItem消息的情况?
有哪些函数可以发出这样的消息呢?

解决方案 »

  1.   

    DrawItem消息是系统发的,WM_DRAWITEMPreSubclassWindow也是系统调用的函数
      

  2.   

    自绘控件的时候调用DrawItem进行重绘,在PreSubclassWindow中设置控件属性为用户自绘
      

  3.   

    PreSubclassWindow 不是消息, 是由 MFC 窗口类负责调用的虚函数,他可能由 CWnd::SubclassWindow 或者 MFC 的 CBT Hook 调用。OnDrawItem 处理 WM_DRAWITEM 消息,参考 MSDN:The WM_DRAWITEM message is sent to the owner 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.