/// 向控制框插入文件名 int COPWILL_FileDialog::InsertFileList( CString szFilePath, BOOL bIsDirectory ) { ASSERT( szFilePath.GetLength()!=0 ); int nIcon = GetIconIndex( szFilePath, bIsDirectory ); CString szFileName; // 是否需要隐藏扩展名 if ( m_bExtendNameState ) { // 文件夹没有扩展名 if ( bIsDirectory) { szFileName=m_CommonTool.GetFileName(szFilePath); m_vecFileExtendNameList.push_back(_T("")); } else { szFileName= m_CommonTool.GetFileNameNoExtend(szFilePath); m_vecFileExtendNameList.push_back(m_CommonTool.GetFileExtendName(szFilePath)); } } else { szFileName= m_CommonTool.GetFileName(szFilePath); } // 显示文件名 return m_FileList.InsertItem( m_FileList.GetItemCount(), szFileName, nIcon ); }