我要做一个录音程序让用户输入录音文件存放路径怎么用那个对话框?
解决方案 »
- 多线程串口采集,cpu占用过高
- 编译错误:致命错误 RC1121: RC : fatal error RC1121 : I/O error reading file,请问如何解决?
- 请教高手,关于读寄存器状态
- 请教一个关于显示和不显示矩形的问题.
- 关于将BMP转化成JPG的问题????
- 如何清除控件上画好的图像?
- 请教怎样修改弹出式菜单的字体和文字大小?
- VC6.0创建的对话框工程如何插入Microsoft Web Browser控件
- 如何调整属性页的大小
- 如何取得文件路径
- 如何在visual c++ mfc 对话框模式下,播放avi文件。只用api函数,不用控件。希望详细点。谢谢
- 菜鸟求救,如何封装控件,急,在线等!解决立刻给分!
http://www.codeguru.com/Cpp/W-D/dislog/dialogforselectingfolders/article.php/c1885/
dlg.DoModal();
MSDN里都找不到
//顯示目錄選擇對話框
BROWSEINFO bInfo;
ZeroMemory(&bInfo, sizeof(bInfo));
bInfo.hwndOwner = AfxGetMainWnd()->m_hWnd;
bInfo.ulFlags = BIF_RETURNONLYFSDIRS;
LPCITEMIDLIST pidList = ::SHBrowseForFolder(&bInfo);
if (pidList == NULL)
return;CString strPath;
::SHGetPathFromIDList(pidList,strPath.GetBuffer(_MAX_PATH));strPath.ReleaseBuffer();strPath就存储选择的文件路径
BROWSEINFO bi;
char dispname[MAX_PATH], path[400]; ITEMIDLIST * pidl;bi.hwndOwner =hDlg;
bi.pidlRoot = 0;
bi.pszDisplayName = dispname;
bi.lpszTitle = "Choose Folder:";
bi.ulFlags = BIF_RETURNONLYFSDIRS;
bi.lpfn = 0;
bi.lParam = 0;
bi.iImage = 0; if (pidl = SHBrowseForFolder(&bi))
{
SHGetPathFromIDList(pidl, path);
strcpy(szSavedDirectory,path);}
BROWSEINFO bInfo;
ZeroMemory(&bInfo, sizeof(bInfo));
bInfo.hwndOwner = AfxGetMainWnd()->m_hWnd;
bInfo.ulFlags = BIF_RETURNONLYFSDIRS;
LPCITEMIDLIST pidList = ::SHBrowseForFolder(&bInfo);
if (pidList == NULL)
return;CString strPath;
::SHGetPathFromIDList(pidList,strPath.GetBuffer(_MAX_PATH));strPath.ReleaseBuffer();strPath就是选择的文件路径