CListCtrl,佷多时候会有要求到每列的宽不能被拖动。
其中 HDN_DIVIDERDBLCLICK 是屏蔽Header双击。 如果不屏掉这个,双击header以后会出现宽度问题。
BOOL CPreDloadEMUList::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
// TODO: Add your specialized code here and/or call the base class
if(wParam == (DWORD)this->GetHeaderCtrl()->GetDlgCtrlID())
{
switch (((NMHDR*)lParam)-> code)
{
case HDN_BEGINTRACKW:
case HDN_BEGINTRACKA:
case HDN_ITEMCHANGEDA:
case HDN_ITEMCHANGEDW:
case HDN_DIVIDERDBLCLICK:
*pResult = TRUE;
return TRUE;
}
}
//return CWnd::OnNotify(wParam, lParam, pResult);
return CListCtrl::OnNotify(wParam, lParam, pResult);
}
BOOL CPreDloadEMUList::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
// TODO: Add your specialized code here and/or call the base class
if(wParam == (DWORD)this->GetHeaderCtrl()->GetDlgCtrlID())
{
switch (((NMHDR*)lParam)-> code)
{
case HDN_BEGINTRACKW:
case HDN_BEGINTRACKA:
case HDN_ITEMCHANGEDA:
case HDN_ITEMCHANGEDW:
case HDN_DIVIDERDBLCLICK:
*pResult = TRUE;
return TRUE;
}
}
//return CWnd::OnNotify(wParam, lParam, pResult);
return CListCtrl::OnNotify(wParam, lParam, pResult);
}