2008/10/08

Folder 선택하기 SHBrowseForFolder

    char m_szWorkPath[MAX_PATH];

LPITEMIDLIST pidlBrowse;
BROWSEINFO info;

info.hwndOwner = this->GetSafeHwnd(); // 부모 윈도우의 핸들
info.pidlRoot = NULL;
info.pszDisplayName = m_szWorkPath;
info.lpszTitle = "Select Directory";
info.ulFlags = BIF_RETURNONLYFSDIRS;
info.lpfn = NULL;
info.lParam = 0; //m_szWorkPath;

pidlBrowse = SHBrowseForFolder(&info); // 다이얼로그를 띄운다.
if(pidlBrowse != NULL)
{
SHGetPathFromIDList(pidlBrowse, m_szWorkPath); // 패스를 얻어온다.
}

Original Post : http://neodreamer-dev.tistory.com/180

No comments :

Post a Comment