WTL中CHeaderCtrl列表头发生变化响应啥消息
HDN_BEGINTRACK HDN_ENDTRACK
NOTIFY_HANDLER(ID_HEADERCTRL,HDN_BEGINTRACK,OnHdnBegintrack) NOTIFY_HANDLER(ID_HEADERCTRL,HDN_ENDTRACK,OnHdnEndtrack) 或者用 MESSAGE_HANDLER(WM_NOTIFY,OnNotify) 都是可以的
class ListHeaderCtrl : public CWindowWithReflectorImpl< ListHeaderCtrl , CHeaderCtrl >
BEGIN_MSG_MAP(ListHeaderCtrl) REFLECTED_NOTIFY_CODE_HANDLER(HDN_BEGINTRACK,OnHeaderBeginTrack) END_MSG_MAP()
LRESULT OnHeaderBeginTrack(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
LRESULT ListHeaderCtrl::OnHeaderEndTrack( int idCtrl, LPNMHDR pnmh, BOOL& bHandled ) { bHandled = TRUE; Invalidate(TRUE); ::InvalidateRect(GetParent(),NULL,FALSE); return S_OK; }
|