Hi there!!
How can I display a window in which I can select a directory, which path I can use afterwards?
I made it once before,but now I just can't find it!!!
Thx
Han
Hi there!!
How can I display a window in which I can select a directory, which path I can use afterwards?
I made it once before,but now I just can't find it!!!
Thx
Han
Assuming you're talking about Windows, try here.
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
In windows the following function will display the directory box and return the directory selected as a CString.
Code:CString GetFolderPath() { CoInitialize(0); char szDirectory[1024]; HRESULT hr; BROWSEINFO browseInfo; LPITEMIDLIST lpItemList=0; LPMALLOC lpM; hr = SHGetMalloc (&lpM) ; if (FAILED(hr) ) return _T(""); ZeroMemory ( (PVOID) &browseInfo,sizeof (BROWSEINFO)); browseInfo.pidlRoot = 0; browseInfo.hwndOwner = NULL; browseInfo.pszDisplayName = szDirectory; browseInfo.lpszTitle = "Open Folder "; browseInfo.ulFlags = BIF_RETURNFSANCESTORS|BIF_RETURNONLYFSDIRS; browseInfo.lParam = 0; if ((lpItemList = SHBrowseForFolder(&browseInfo)) == NULL) { return _T(""); } SHGetPathFromIDList(lpItemList,szDirectory); lpM->Free(lpItemList); lpM->Release(); CString strPath; strPath = _T(szDirectory); return strPath; }
zMan