Custom Draw confusion
-
I'm trying to figure out how to remove the dashed focus cue from around one of my controls, a track bar. Based on the documentation on MSDN for custom drawing, here: http://msdn.microsoft.com/en-us/library/ff919569(v=VS.85).aspx#CustomDraw_DrawingItemsYourself I've set up the following in the parent window
NM_CUSTOMDRAW
handler:NMCUSTOMDRAW* pzCustomDraw;
LRESULT lResult = CDRF_DODEFAULT;
switch( iID )
{
case IDC_FONTSIZE_SLIDER:
case IDC_OFFSET_X_SLIDER:
case IDC_OFFSET_Y_SLIDER:
case IDC_CHOOSECOLOUR:
pzCustomDraw = reinterpret_cast< NMCUSTOMDRAW* >( pzNMHdr );if( pzCustomDraw->dwDrawStage == CDDS\_PREPAINT ) {
// lResult = CDRF_SKIPPOSTPAINT;
lResult = CDRF_NOTIFYITEMDRAW;
}
else if( pzCustomDraw->dwDrawStage == CDDS_ITEMPREPAINT )
{
lResult = CDRF_SKIPPOSTPAINT;
}break;
}
bHandled = TRUE;
return lResult;
The MSDN article linked above states: CDRF_SKIPPOSTPAINT - The control will not draw the focus rectangle around an item. But doesn't indicate that the dwDrawState is anything other than the
CDDS_PREPAINT
, however as you can see I tried both forCDDS_PREPAINT
andCDDS_ITEMPREPAINT
. Neither of these actually do anything. The result is set correct, and returned, but the control still draws the focus cue. I'm thinking that the documentation just fails to indicate that this only works on list-view and tree-view controls, or can someone see something I'm doing wrong? Thanks, CraigL