Dialog für Directorys
-
Hallo!
Ich benötige einen Dialog zum auswählen eines Directorys (Grund: Möchte alle Files herauslesen). Soll so aussehen wie im WinAmp beim auslesen aus einem Directory. Gibt es da in MFC etwas vorgefertigtes??
Bitte um Hilfe!!
-
Hab ich mir irgendwan mal kopiert:
BROWSEINFO bi; TCHAR szDisplayName[MAX_PATH]; LPITEMIDLIST pidl; LPMALLOC pMalloc = NULL; ZeroMemory(&bi, sizeof(bi)); bi.hwndOwner = NULL; bi.pszDisplayName = szDisplayName; bi.lpszTitle = TEXT("Wählen sie einen Ordner aus:"); bi.ulFlags = BIF_RETURNONLYFSDIRS; pidl = SHBrowseForFolder(&bi); CString Pfad; //Da is dann der Pfad drin if ( pidl != 0 ) { // get the name of the folder TCHAR path[MAX_PATH]; if ( SHGetPathFromIDList ( pidl, path ) ) { Pfad.Format("%s",path); } // free memory used IMalloc * imalloc = 0; if ( SUCCEEDED( SHGetMalloc ( &imalloc )) ) { imalloc->Free ( pidl ); imalloc->Release ( ); } }
-
Danke für die rasche Hilfe!!
Das Beispiel kann ich gut gebrauchen!