⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filelist.cpp

📁 《Visual C++ 6.0实例教程》配套代码
💻 CPP
字号:
// FileList.cpp : implementation file
//

#include "stdafx.h"
#include "FileList.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CFileList

CFileList::CFileList()
{
	m_strFilter = "*.*";
}

CFileList::~CFileList()
{
}


BEGIN_MESSAGE_MAP(CFileList, CListBox)
	//{{AFX_MSG_MAP(CFileList)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFileList message handlers
void CFileList::FillListBox(CString csPath)
{
	int nDir = 0;

	if (csPath.Right(1)  != '\\')
		csPath += '\\';
	csPath += m_strFilter;

	ResetContent(); 

	CFileFind FoundFiles;
	BOOL bContinue = FoundFiles.FindFile(csPath);

	while (bContinue == TRUE)
	{
		bContinue = FoundFiles.FindNextFile();
		int nIndex = GetCount();

		if (FoundFiles.IsDirectory())
			continue;

		this->AddString(FoundFiles.GetFileName()); //, nIcon);
	}
	
	FoundFiles.Close();
}

void CFileList::SetFilter(CString strFilter)
{
	m_strFilter = strFilter;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -