列表控件的问题

wanghesir 2003-07-08 09:03:19
如何用列表控件来显示机器的硬盘盘符
用什么方法和函数
...全文
50 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
wanghesir 2003-07-08
  • 打赏
  • 举报
回复
取得所有盘符后用什么方法把它显示在列表控件上呢?
SeainBlue 2003-07-08
  • 打赏
  • 举报
回复
上面的是取得所有盘符
函数为:GetLogicalDriveStrings
SeainBlue 2003-07-08
  • 打赏
  • 举报
回复
CString CMYApp::GetDriveStringT()
{
CHAR SysDir[128]=_T("");
int strLen=0;
CString strSysDir = "";
strLen=GetLogicalDriveStrings(sizeof(SysDir),SysDir);
if(strLen!=0)
{
for(int i=0;i<strLen;i++)
{
if(SysDir[i]=='\0')
SysDir[i]='+';
}
}
strSysDir.Format("%s",SysDir);
if(strSysDir.Right(1) == "+")
strSysDir = strSysDir.Left(strSysDir.GetLength() - 1);
return strSysDir;
}

返回的值类似于这样:
"A:\+C:\+D:\+E:\+F:\"
SeainBlue 2003-07-08
  • 打赏
  • 举报
回复


取系统目录:GetSystemDirectory

UINT GetSystemDirectory(
LPTSTR lpBuffer, // buffer for system directory
UINT uSize // size of directory buffer
);
feiniaoliang 2003-07-08
  • 打赏
  • 举报
回复
使用IShellfolder接口!!

15,980

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧