CTreeCtrl不能显示节点图片!
在一个窗口上显示CTreeCtrl时,不能显示节点图片.下面是一个图片高:32,共12个小图。每个宽度也是32.请大家帮帮忙。谢谢!BOOL CConfigDialog::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
DWORD dwStyle = GetWindowLong(m_tree.m_hWnd,GWL_STYLE);
dwStyle |= TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT;
SetWindowLong(m_tree.m_hWnd,GWL_STYLE,dwStyle);
CImageList imageList;
CBitmap treeBitmap;
BOOL success=imageList.Create(CONFIG_ICON_HEIGHT, CONFIG_ICON_WIDTH, ILC_COLOR8|ILC_MASK , CONFIG_ICON_CNT, CONFIG_ICON_ADD);
BOOL loadSuccess=treeBitmap.LoadBitmap(IDB_BITMAP_CONFIG);
int index=imageList.Add(&treeBitmap,RGB(255,255,255));
CImageList *pOldList=m_tree.SetImageList(&imageList,TVSIL_NORMAL);
HTREEITEM hItem;
hItem = m_tree.InsertItem("Directories",0,0,TVI_ROOT);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}