MFC CListCtrl 设置高度,MeasureItem函数不响应
- 添加消息响应函数
void *::MeasureItem( LPMEASUREITEMSTRUCT lpMeasureItemStruct )
{
}
消息映射部分添加消息,ON_WM_MEASUREITEM_REFLECT()
默认消息ON_WM_MEASUREITEM_REFLECT不会被触发,可在PreSubclassWindow设置
void *::PreSubclassWindow()
{
CRect rcWin;
GetWindowRect(&rcWin);
WINDOWPOS wp;
wp.hwnd = m_hWnd;
wp.cx = rcWin.Width();
wp.cy = rcWin.Height();
wp.flags = SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOZORDER;
SendMessage(WM_WINDOWPOSCHANGED, 0, (LPARAM)&wp);
}
2.函数MeasureItem不响应
设置Clistctrl ownerDraw属性;