1,
HIMAGELIST m_imageList;
m_imageList = ImageList_Create(16,16,ILC_COLOR24,1,1);
ImageList_SetBkColor(m_imageList, IMAGELIST_BKCOLOR);
ImageList_AddIcon(m_imageList, GetIcon(IDI_DIR));
ImageList_AddIcon(m_imageList, GetIcon(IDI_IMAGEFILE));
ImageList_AddIcon(m_imageList, GetIcon(IDI_PDFFILE));
ImageList_AddIcon(m_imageList, GetIcon(IDI_ICON_TEXT));
ImageList_AddIcon(m_imageList, GetIcon(IDI_ICON_OTHER));
TreeView_SetImageList(m_hTree, m_imageList, TVSIL_NORMAL);
2,
CImageList m_imageTree;
CBitmap cBmp;
m_imageTree.create(16,16,ILC_COLOR24,1,1);
cBmp.LoadBitmap(IDB_TREEIMAGE);
m_imageTree.Add(&cBmp, RGB(255,255,255));
m_tree.SetImageList( &m_imageTree, TVSIL_NORMAL);
m_tree.ModifyStyle(NULL, TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | LVS_SORTDESCENDING);