📄 dlgselectpath.cpp
字号:
// DlgSelectPath.cpp: implementation of the CDlgSelectPath class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "basefunc.h"
#include "DlgSelectPath.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CDlgSelectPath::CDlgSelectPath()
{
}
CDlgSelectPath::~CDlgSelectPath()
{
}
int CDlgSelectPath::DoModal()
{
BROWSEINFO bwInfo;
ZeroMemory(&bwInfo,sizeof(BROWSEINFO));
bwInfo.hwndOwner = AfxGetApp()->m_pMainWnd->GetSafeHwnd();
bwInfo.lpszTitle = "选择文件路径";
bwInfo.ulFlags = BIF_RETURNONLYFSDIRS;
LPITEMIDLIST pItemList = ::SHBrowseForFolder(&bwInfo);
if(pItemList == NULL)
{
return IDCANCEL;
}
else
{
IMalloc *pMalloc = NULL;
::SHGetMalloc(&pMalloc);
TCHAR path[MAX_PATH];
::SHGetPathFromIDList(pItemList,path);
m_strPath = path;
pMalloc->Free(pItemList);
pMalloc->Release();
return IDOK;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -