GSI

void ChoiceDirectoryPath(char* pathFolder)
{
 ASSERT( pathFolder );
 
 sprintf( pathFolder, "" );
 
 //CString m_strDirPath;
 ITEMIDLIST *pidlBrowse;
 char pszPathname[MAX_PATH];
 BROWSEINFO BrInfo;
 BrInfo.hwndOwner = NULL; //GetSafeHwnd();
 BrInfo.pidlRoot = NULL;
 memset( &BrInfo, 0, sizeof(BrInfo) );
 BrInfo.pszDisplayName = (LPSTR)pszPathname;
 BrInfo.lpszTitle = _T("폴더를 선택해 주세요.");
 BrInfo.ulFlags = BIF_RETURNONLYFSDIRS;
 // 다이얼로그 뛰우기
 pidlBrowse = SHBrowseForFolder(&BrInfo);
 if(pidlBrowse != NULL)
 {
  BOOL bSuccess = ::SHGetPathFromIDList(pidlBrowse, (LPSTR)pszPathname);
  if( bSuccess )
  {
   sprintf( pathFolder, "%s", pszPathname );
  }
 }
}

// 사용할때
 char szDirectory[MAX_PATH];
 ZeroMemory( szDirectory, sizeof(szDirectory) );
 ChoiceDirectoryPath( szDirectory );
 if( strlen(szDirectory) <= 0 )
  return 0;

Posted by gsi
: