void CICCViewerDlg::OnDblclkFiles(NMHDR* pNMHDR, LRESULT* pResult) { ExecuteFile(); *pResult = 0; } void CICCViewerDlg::ExecuteFile() { if(m_tcFiles.GetCount() > 0) { HTREEITEM hElement = m_tcFiles.GetSelectedItem(); CString strTemp = ""; CString strFile = m_tcFiles.GetItemText(hElement); if(m_tcFiles.GetParentItem(hElement) != NULL) { while(hElement != NULL) { strTemp = strFile; hElement = m_tcFiles.GetParentItem(hElement); if(hElement != NULL) strFile.Format("%s\\%s", m_tcFiles.GetItemText(hElement), strTemp); } strTemp = strFile.Mid(strlen(m_pCurCom->GetKommission())+1); strFile.Format("%s\\%s", m_pCurCom->GetPath(), strTemp); } else strFile = m_pCurCom->GetPath(); if(m_dlgProperties.m_bHideOnOpen) this->ShowWindow(SW_MINIMIZE); ShellExecute(0, "open", strFile, 0,0, SW_SHOWNORMAL); } }