Custom draw is mot a common control; it is a service that many common controls provide. The custom draw service allows an application greater flexibility in customizing a control’s appearance.
Your application can harness custom draw notification to easily change the font used to display items or manually draw an item without having to do a full owner draw.
The following is an example for tree-view control.
// .cppON_NOTIFY_REFLECT(NM_CUSTOMDRAW,&OnNMCustomdraw)voidOnNMCustomdraw(NMHDR*pNMHDR,LRESULT*pResult){LPNMTVCUSTOMDRAWpCustomDraw=(LPNMTVCUSTOMDRAW)pNMHDR;switch(pCustomDraw->nmcd.dwDrawStage){caseCDDS_PREPAINT:// Need to process this case and set pResult to CDRF_NOTIFYITEMDRAW,// otherwise parent will never receive CDDS_ITEMPREPAINT notification.*pResult=CDRF_NOTIFYITEMDRAW;return;caseCDDS_ITEMPREPAINT:if(pCustomDraw->nmcd.uItemState&CDIS_SELECTED){// Change selected item text color and text backgroud colorpCustomDraw->clrText=RGB(255,255,255);// WhitepCustomDraw->clrTextBk=RGB(0,0,255);// Blue*pResult=CDRF_NEWFONT;// Drawing the item yourself// CDC* pDc = CDC::FromHandle(pCustomDraw->nmcd.hdc);// *pResult = CDRF_SKIPDEFAULT;}break;default:break;}}