void CSelectChan::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct) { // TODO: Add your message handler code here and/or call default switch(nIDCtl) { case IDC_STA: DrawListViewItem(lpDrawItemStruct, 1); break; case IDC_CHAN: DrawListViewItem(lpDrawItemStruct, 2); break; default: CPropertyPage::OnDrawItem(nIDCtl, lpDrawItemStruct); break; } }
void OpenFileDlg::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct) { // TODO: Add your message handler code here and/or call default void DrawListViewItem(LPDRAWITEMSTRUCT lpDrawItem, int nColumns); switch(nIDCtl) { case IDC_LIST: DrawListViewItem(lpDrawItemStruct, 5); return; } CFileDialog::OnDrawItem(nIDCtl, lpDrawItemStruct); }
BOOL Main_OnDrawItem(HWND hwnd, const DRAWITEMSTRUCT * lpDrawItem) { // Make sure the control is the listview control if ((lpDrawItem->CtlType != ODT_LISTVIEW)&& (lpDrawItem->CtlType != ODT_LISTBOX)) return FALSE; if(!IsWindowEnabled(lpDrawItem->hwndItem)) return FALSE; switch (lpDrawItem->itemAction) { case ODA_DRAWENTIRE: case ODA_FOCUS: case ODA_SELECT: DrawListViewItem((LPDRAWITEMSTRUCT)lpDrawItem); break; } return TRUE; }