ListCtrl怎么样才能插入一个圆形的Item?
void CListCtrlEx::OnCustomDraw(NMHDR *pNMHDR, LRESULT *pResult)
{
NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);
// Take the default processing unless we set this to something else below.
*pResult = CDRF_DODEFAULT;
// First thing - check the draw stage. If it's the control's prepaint
// stage, then tell Windows we want messages for every item.
if (pLVCD->nmcd.dwDrawStage == CDDS_PREPAINT)
{
*pResult = CDRF_NOTIFYITEMDRAW;
}
else if (pLVCD->nmcd.dwDrawStage == CDDS_ITEMPREPAINT)
{
// This is the notification message for an item. We'll request
// notifications before each subitem's prepaint stage.
CImageList * pImageList=GetImageList(0);
int nItem = static_cast<int> (pLVCD->nmcd.dwItemSpec);
CDC* pDC = CDC::FromHandle(pLVCD->nmcd.hdc);
CRect rect;
GetSubItemRect(nItem, 0, LVIR_BOUNDS, rect);
pImageList->DrawIndirect(pDC,nItem,rect.TopLeft(),CSize(25,25),CPoint(0,0)
,ILD_TRANSPARENT,PATPAINT,CLR_NONE,CLR_NONE);
*pResult = CDRF_SKIPDEFAULT;
//*pResult = CDRF_NOTIFYITEMDRAW;
}
}