Display Folder dialog box, return to the path to select the folder

xiaoxiao2021-03-06  66

// 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;

转载请注明原文地址:https://www.9cbs.com/read-88719.html

New Post(0)