发信人: seaquake()
整理人: wenbobo(2002-12-27 15:57:42), 站内信件
|
【 在 lgwzxm (大眼眶) 的大作中提到: 】
: 在vc中打开文件对话框可以用CFileDialog类的DoModul()实现,但不知道选择路
: 径对话框如何实现,请各位热心人帮帮忙,请在寄一份给原作者后面打个勾,谢
: 谢了!
void CTest::SelectDirDlg(char Dir[])
{
BROWSEINFO bi;
ITEMIDLIST *pidl;
bi.hwndOwner = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = Dir;
bi.lpszTitle = "选择一个目录";
bi.ulFlags = BIF_RETURNONLYFSDIRS;
bi.lpfn = NULL;
bi.lParam = 0;
bi.iImage = 0;
pidl = SHBrowseForFolder( &bi ); /* Display "Select Folde r" dialog box, Get the
folder name and co nvert it into a ITEMLIST
data structure. */
if ( pidl == NULL )
Dir[0] = 0;
if (!SHGetPathFromIDList( pidl, Dir )) /* Retrieve folder name from ITEMLIST structure. */
Dir[0] = 0;
}
-- ※ 来源:.月光软件站 http://www.moon-soft.com.[FROM: 202.96.181.240]
|
|