|
|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
//////////////////////////////////////////////////////////////////////////
//函数名称:InitPath
//函数介绍:初始化逻辑分区,仅关心硬盘分区
//输入参数:无
//输出参数:无
//返回值: 无
//////////////////////////////////////////////////////////////////////////
void CFileAssistantDlg::InitPath(void)
{
wchar_t *pLogicalDrives = new wchar_t[MAX_PATH];
pLogicalDrives[0] = '\0';
int nLen = GetLogicalDriveStrings(MAX_PATH-1,pLogicalDrives);
if (0 == nLen)
{
return;
}
int nDriverNameLength = wcslen(L"C:\\")+1; 这里为什么要加一。
int i = 0;
TVINSERTSTRUCT tvInsertItem;
tvInsertItem.hParent = NULL;
tvInsertItem.hInsertAfter = NULL;
tvInsertItem.item.mask = TVIF_TEXT;
do
{
tvInsertItem.item.pszText = pLogicalDrives+i;
m_tcDirectories.InsertItem(&tvInsertItem);
i += nDriverNameLength;
} while (i<nLen);
delete[] pLogicalDrives;//回收缓冲区
}
代码:
FileAssistant.rar
(34.66 KB, 下载次数: 0)
|
|