본문 바로가기

개발/Client Side

[MFC] CFolderDialog 예제

TCHAR szDestPath[MAX_PATH];
 LPCTSTR lpszTitle = _T( "Select the root folder for the browse dialog:" );
 UINT uFlags   = BIF_RETURNONLYFSDIRS | BIF_USENEWUI;

 CFolderDialog dlgRoot(lpszTitle, szDestPath, this, uFlags );

 if( dlgRoot.DoModal() == IDOK )
 {
  lstrcpy(szDestPath, dlgRoot.GetFolderPath());
 }