GetItem(lpDrawItemStruct->itemID, &hdi);
void CColumnDlg::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) { // This code only works with header controls. ASSERT(lpDrawItemStruct->CtlType == ODT_HEADER); HDITEM hdi; TCHAR lpBuffer[256]; hdi.mask = HDI_TEXT; hdi.pszText = lpBuffer; hdi.cchTextMax = 256; GetItem(lpDrawItemStruct->itemID, &hdi); // Draw the button frame. ::DrawFrameControl(lpDrawItemStruct->hDC, &lpDrawItemStruct->rcItem, DFC_BUTTON, DFCS_BUTTONPUSH); // Draw the text items using the text color red. COLORREF crOldColor = ::SetTextColor(lpDrawItemStruct->hDC, RGB(255,0,0)); ::DrawText(lpDrawItemStruct->hDC, lpBuffer, strlen(lpBuffer), &lpDrawItemStruct->rcItem, DT_SINGLELINE|DT_VCENTER|DT_CENTER); ::SetTextColor(lpDrawItemStruct->hDC, crOldColor); }
lpDrawItemStruct->itemID
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)