"Ordner öffen ..." Dialog
-
Weis einer wie man den erzeugen kann?
-
-
Warum so kompliziert? Ich habe immer das Benutz aber da is jetzt der Wurm drin.
BROWSEINFO bi; TCHAR szDisplayName[MAX_PATH]; TCHAR path[MAX_PATH]; LPITEMIDLIST pidl; LPMALLOC pMalloc = NULL; ZeroMemory(&bi, sizeof(bi)); bi.hwndOwner = NULL; bi.pszDisplayName = szDisplayName; bi.lpszTitle = TEXT("Ordner Wählen"); bi.ulFlags = BIF_RETURNONLYFSDIRS; pidl = SHBrowseForFolder(&bi); if ( pidl != 0 ) { if ( SHGetPathFromIDList ( pidl, path ) ) { MessageBox(path); } IMalloc * imalloc = 0; if ( SUCCEEDED( SHGetMalloc ( &imalloc )) ) { imalloc->Free ( pidl ); imalloc->Release ( ); } }
-
Das ist aber fast reines C mit WinApi...
Devil
-
Ja aber 100% kürtzer.
-
BROWSEINFO Bif; LPITEMIDLIST lpIDList; TCHAR szBuffer[MAX_PATH]; ZeroMemory(&Bif,sizeof(Bif)); Bif.hwndOwner = m_hWnd; Bif.lspzTitle = "Ordner wählen"; Bif.ulFlags = BIF_USENEWGUI; if (lpIDList = SHBrowseForFolder(&Bif)) { SHGetPathFromIDList(lpIDList,szBuffer); MessageBox(szBuffer); }