// Display Folder dialog, return the path of the selected Fountain clip CSTRING BROWSEFORFOLDER (hwnd hwnd) {tchar sztitle [] = _t ("select a folder"); tchar szdisplayname [MAX_PATH] = _t ("); tchar szpath [ MAX_PATH] = _T ( ""); BROWSEINFO bi; bi.hwndOwner = hWnd; bi.pidlRoot = NULL; bi.lpszTitle = szTitle; bi.pszDisplayName = szDisplayName; bi.ulFlags = BIF_RETURNONLYFSDIRS; bi.lpfn = NULL; bi. lParam = 0; LPITEMIDLIST pItemIDList = SHBrowseForFolder (& bi); if (pItemIDList) {SHGetPathFromIDList (pItemIDList, szPath); IMalloc * pMalloc; if (! SHGetMalloc (& pMalloc) = NOERROR) {TRACE ( "Failed to get pointer to shells task allocator "); Return szpath;} pmalloc-> free (pithmidlist); if (pmalloc) pmalloc-> release ();} return szpath;}