level 2
void CFileView::OnSelChanged(NMHDR *pNmHdr, LRESULT *pResult)
{
LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNmHdr);
// TODO: Add your control notification handler code here
*pResult = 0;
CString strText; // 树节点的标签文本字符串
// 获取当前选中节点的句柄
HTREEITEM hItem = m_wndFileView.GetSelectedItem();
// 获取选中节点的标签文本字符串
m_mainstr = m_wndFileView.GetItemText(hItem);
// 将字符串显示到编辑框中
//UpdateData(FALSE);
if (hItem == hRoot)
{
m_wndFileView.InsertItem(_T("RNMMP.bmp"), 2, 2, hSrc); //在file view里再加一个子节点
}
//if (m_hSelect == hRoot)
//{
//SetDlgItemText(IDC_EDIT1,_T("1"));
//}
}
2017年03月15日 08点03分