来源(null)

void CTreeCtrlDlg::InitTreeCtrl1()
{
	CImageList *pImgList=new CImageList;
	HTREEITEM hItem,hSubItem,hSubItem1;

	pImgList->Create(IDB_TREE,16,2,RGB(0,0,0));
	m_tree.SetImageList(pImgList,TVSIL_NORMAL);

	hItem=m_tree.InsertItem("Parent1",0,1,TVI_ROOT);
	hSubItem=m_tree.InsertItem("Child1_1",0,1,hItem);
	hSubItem=m_tree.InsertItem("Child1_2",0,1,hItem,hSubItem);
	hSubItem=m_tree.InsertItem("Child1_3",0,1,hItem,hSubItem);

	hItem=m_tree.InsertItem("Parent2",0,1,TVI_ROOT,hItem);
	hSubItem=m_tree.InsertItem("Child2_1",0,1,hItem);
	hSubItem1=m_tree.InsertItem("CChild2_1_1",0,1,hSubItem);
	hSubItem1=m_tree.InsertItem("CChild2_1_2",0,1,hSubItem,hSubItem1);
	hSubItem=m_tree.InsertItem("Child2_2",0,1,hItem,hSubItem);
	hSubItem=m_tree.InsertItem("Child2_3",0,1,hItem,hSubItem);

	hItem=m_tree.InsertItem("Parent3",0,1,TVI_ROOT,hItem);
	hSubItem=m_tree.InsertItem("Child3_1",0,1,hItem);
	hSubItem=m_tree.InsertItem("Child3_2",0,1,hItem,hSubItem);
	hSubItem=m_tree.InsertItem("Child3_3",0,1,hItem,hSubItem);

}


Link: http://www.asm32.net/article_details.aspx?id=84