![]() |
#2
liqi20092012-08-31 09:28
|
只有本站会员才能查看附件,请 登录
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
}