代码拉取完成,页面将自动刷新
//---------------------------------------------------------------------------
#define NO_WIN32_LEAN_AND_MEAN // 从 Windows 头中排除极少使用的资料
#include <shlobj.h>
#include <vcl.h>
#pragma hdrstop
#include "selectdir.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
bool CrnBrowserDir(HANDLE hWin, LPSTR lpCaption, LPSTR lpDir, LPSTR lpDispName)
{
BROWSEINFO bi;
LPITEMIDLIST pidl;
LPMALLOC pShellMalloc;
bool bRet = false;
if(SHGetMalloc(&pShellMalloc) == NO_ERROR)
{
memset(&bi, 0x00, sizeof(bi));
bi.hwndOwner = hWin; // Owner window
bi.pidlRoot = 0; // root folder
bi.pszDisplayName = lpDispName; // return display name
bi.lpszTitle = lpCaption; // label caption
bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_NEWDIALOGSTYLE; // config flags
bi.lpfn = 0; // callback function
pidl = SHBrowseForFolder(&bi);
if(pidl)
{
if(SHGetPathFromIDList(pidl, lpDir))
bRet = true;
pShellMalloc->Free(pidl);
}
pShellMalloc->Release();
}
return bRet;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。