ここにコードからの抜粋があります。作成前のツールバーのスタイル:
DWORD styles = TBSTYLE_FLAT | WS_CHILD | TBSTYLE_TOOLTIPS; //| TBSTYLE_CUSTOMERASE;//| WS_BORDER ;
DWORD cc_styles = CCS_VERT | CCS_NODIVIDER | CCS_NORESIZE;
NM_CUSTOMDRAW の処理:
case WM_NOTIFY:
switch ( ((LPNMHDR)lparam)->code )
{
...
case NM_CUSTOMDRAW:
{
//LPNMHDR header_ptr = safe_ptr_cast< LPNMHDR >( &lparam );
//if ( header_ptr->hwndFrom == m_ptr->get_operation_tab_toolbar_handle( ) )
LPNMTBCUSTOMDRAW data_ptr = (LPNMTBCUSTOMDRAW) lparam;
switch(data_ptr->nmcd.dwDrawStage)
{
case CDDS_ITEMPREPAINT:
SetWindowTheme(m_ptr->get_operation_tab_toolbar_handle(), _T(""), _T(""));
//data_ptr->hbrMonoDither = GetStockBrush(BLACK_BRUSH);
SetBkColor( data_ptr->nmcd.hdc, RGB(0,0,0));
FillRect( data_ptr->nmcd.hdc, &data_ptr->nmcd.rc, RGB(0,0,0));
//FillRect( data_ptr->nmcd.hdc, &data_ptr->nmcd.rc, GetStockBrush(BLACK_BRUSH));
return CDRF_NEWFONT;
case CDDS_PREPAINT:
{
return CDRF_NOTIFYITEMDRAW;
}
}
}
}
CDDS_PREPAINT しか受け取りません。ドキュメントMSDN Custom Drawing Doc で。 戻り値 CDRF_NOTIFYITEMDRAW CDDS_ITEMPREPAINT が次に来るはずだと言われています。