📄 folder.cpp
字号:
// Folder.cpp: implementation of the CFolder class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Folder.h"
#include <windows.h>
#include <shlobj.h>
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CFolder::CFolder()
{
}
CFolder::~CFolder()
{
}
std::string CFolder::GetFolder()
{
BROWSEINFO BrowseInfo ;
std::string strret;
memset(&BrowseInfo,0,sizeof(BrowseInfo));
BrowseInfo.lpszTitle = "Please choose a directory";
BrowseInfo.ulFlags = BIF_RETURNONLYFSDIRS ;
LPITEMIDLIST lpItemIDList = SHBrowseForFolder ( &BrowseInfo );
if ( lpItemIDList != 0 )
{
char path[MAX_PATH];
if (SHGetPathFromIDList ( lpItemIDList, path ) )
{
////////////////////
strret = path;
////////////////////
}
IMalloc * iMalloc = 0;
if ( SHGetMalloc ( &iMalloc ) )
{
iMalloc->Free ( lpItemIDList );
iMalloc->Release ( );
}
}
return strret;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -