6 Star 3 Fork 0

甘才军 / CTestAutoJudge

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
selectdir.cpp 1.15 KB
一键复制 编辑 原始数据 按行查看 历史
//---------------------------------------------------------------------------
#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;
}
C++
1
https://gitee.com/gancaijun/CTestAutoJudge.git
git@gitee.com:gancaijun/CTestAutoJudge.git
gancaijun
CTestAutoJudge
CTestAutoJudge
develop

搜索帮助