如何改变该对话框的标题?
2 个解决方案
#1
#include <direct.h>
#include <shlobj.h>
//Code
BROWSEINFO bi ={0};
char pszDisplayName[MAX_PATH] ="\0";
bi.pszDisplayName = pszDisplayName;
bi.lpszTitle="Select a folder:";
bi.hwndOwner=m_hWnd;
bi.ulFlags=BIF_DONTGOBELOWDOMAIN|BIF_RETURNONLYFSDIRS;
LPITEMIDLIST lpIL = SHBrowseForFolder(&bi);
if(lpIL)
{
SHGetPathFromIDList(lpIL,bi.pszDisplayName);
MessageBox(bi.pszDisplayName);//Drv Here
}
#include <shlobj.h>
//Code
BROWSEINFO bi ={0};
char pszDisplayName[MAX_PATH] ="\0";
bi.pszDisplayName = pszDisplayName;
bi.lpszTitle="Select a folder:";
bi.hwndOwner=m_hWnd;
bi.ulFlags=BIF_DONTGOBELOWDOMAIN|BIF_RETURNONLYFSDIRS;
LPITEMIDLIST lpIL = SHBrowseForFolder(&bi);
if(lpIL)
{
SHGetPathFromIDList(lpIL,bi.pszDisplayName);
MessageBox(bi.pszDisplayName);//Drv Here
}
#2
char lpDIR[MAX_PATH];
LPITEMIDLIST il;
BROWSEINFO bi;
bi.hwndOwner=hWnd;
bi.pidlRoot=NULL;
bi.pszDisplayName=lpDIR;
bi.lpszTitle="请选择保存文件的默认目录";
bi.ulFlags=0;//BIF_BROWSEINCLUDEFILES ;
bi.lpfn=NULL;
bi.lParam=0;
bi.iImage=0;
il=SHBrowseForFolder(&bi);
if(il==NULL)
break;
if(SHGetPathFromIDList(il,lpDIR)==true)//得到选定目录,
{
int i;//在后面补“/”
i=strlen(lpDIR);
if(lpDIR[i-1]!='\\')
{
lpDIR[i]='\\';
lpDIR[i+1]=0;
}
}
#1
#include <direct.h>
#include <shlobj.h>
//Code
BROWSEINFO bi ={0};
char pszDisplayName[MAX_PATH] ="\0";
bi.pszDisplayName = pszDisplayName;
bi.lpszTitle="Select a folder:";
bi.hwndOwner=m_hWnd;
bi.ulFlags=BIF_DONTGOBELOWDOMAIN|BIF_RETURNONLYFSDIRS;
LPITEMIDLIST lpIL = SHBrowseForFolder(&bi);
if(lpIL)
{
SHGetPathFromIDList(lpIL,bi.pszDisplayName);
MessageBox(bi.pszDisplayName);//Drv Here
}
#include <shlobj.h>
//Code
BROWSEINFO bi ={0};
char pszDisplayName[MAX_PATH] ="\0";
bi.pszDisplayName = pszDisplayName;
bi.lpszTitle="Select a folder:";
bi.hwndOwner=m_hWnd;
bi.ulFlags=BIF_DONTGOBELOWDOMAIN|BIF_RETURNONLYFSDIRS;
LPITEMIDLIST lpIL = SHBrowseForFolder(&bi);
if(lpIL)
{
SHGetPathFromIDList(lpIL,bi.pszDisplayName);
MessageBox(bi.pszDisplayName);//Drv Here
}
#2
char lpDIR[MAX_PATH];
LPITEMIDLIST il;
BROWSEINFO bi;
bi.hwndOwner=hWnd;
bi.pidlRoot=NULL;
bi.pszDisplayName=lpDIR;
bi.lpszTitle="请选择保存文件的默认目录";
bi.ulFlags=0;//BIF_BROWSEINCLUDEFILES ;
bi.lpfn=NULL;
bi.lParam=0;
bi.iImage=0;
il=SHBrowseForFolder(&bi);
if(il==NULL)
break;
if(SHGetPathFromIDList(il,lpDIR)==true)//得到选定目录,
{
int i;//在后面补“/”
i=strlen(lpDIR);
if(lpDIR[i-1]!='\\')
{
lpDIR[i]='\\';
lpDIR[i+1]=0;
}
}