//------------------------------------------------
// 파일의 리스트 및 각 파일에 대한 자세한 정보를 
// 함께 저장하게 됨
// data.h파일에 해당 구조체를 선언한다.
//--------------------------------------------------
void CMyExplorerDoc::SelectTreeViewFolder(CString strFullName)
{

	LIST_VIEW*	pListView;
	CFileFind	ff;

	// 사용자가 폴더를 선택할 때마다 파일 리스트를
	// 새로 업데이트 해야 함
	// 따라서 기존 정보를 모두 삭제한다.
	if (m_pFileList != NULL)
		RemoveAllFileList();

	m_pFileList = new CObList;

	SetCurrentPath(strFullName);
	strFullName += "*.*";

	if (ff.FindFile(strFullName) == TRUE)
	{
		BOOL	bFlag = TRUE;
		while(bFlag == TRUE)
		{
			bFlag = ff.FindNextFile();

			// 디렉토리 , 도트파일이면 다시 찾음 
			if (ff.IsDirectory() || ff.IsDots())
				continue;
			
			// 파일 정보를 알아내서LIST_VIEW 구조체에 
			// 저장한 후 
			// 그것을 모두 m_pFileList에 저장한다.
			pListView = new LIST_VIEW;
			InitListViewStruct(pListView);

			pListView->strName = ff.GetFileName();
			pListView->strPath = ff.GetFilePath();

			CString		strName = pListView->strName;
			CString		strExt = ff.GetFileTitle();

			int			nNum = strName.GetLength() - strExt.GetLength();

			if (nNum == 0)
				strExt = "";
			else
				strExt = strName.Right(nNum - 1);
			pListView->strKind = strExt + " 파일";
			pListView->dwFileSize = ff.GetLength();

			CTime	time;
			if (ff.GetCreationTime(time) == TRUE)
				pListView->tCreateTime = time;
			if (ff.GetLastAccessTime(time) == TRUE)
				pListView->tLastAccessTime = time;
			if (ff.GetLastWriteTime(time) == TRUE)
				pListView->tLastWriteTime = time;
			if (ff.IsHidden() == TRUE)
				pListView->bIsHidden = TRUE;
			if (ff.IsReadOnly() == TRUE)
				pListView->bIsReadOnly = TRUE;
			if (ff.IsArchived() == TRUE)
				pListView->bIsArchived = TRUE;
			if (ff.IsSystem() == TRUE)
				pListView->bIsSystem = TRUE;

			m_pFileList->AddTail((CObject*)pListView);
		}
	}
	ff.Close();

	//------------------------------
	m_pExpListView->SetFileList();
	//-------------------------------------
}