Computer wählen Dialog
-
Ich möchte einen Auswahldialog für Computer anzeigen.
Mir ist nur schleierhaft, wie ich den Startpfad auf
die Netzwerkumgebung umbiege. Ich habe div. Varianten
mit CSIDL_NETHOOD und SHGetSpecialFolderPath versucht.
Nie lande ich in der Netzwerkumgebung...Hier mein letzter Versuch...Hoffe ihr könnt helfen

BROWSEINFO bi; TCHAR szDisplayName[MAX_PATH]; LPITEMIDLIST ppidl = NULL; LPMALLOC pMalloc = NULL; ZeroMemory(&bi, sizeof(bi)); bi.pidlRoot = ppidl; bi.lpfn = NULL; bi.hwndOwner = NULL; bi.pszDisplayName = szDisplayName; bi.lpszTitle = TEXT("Wählen Sie bitte einen PC aus."); bi.ulFlags = BIF_BROWSEFORCOMPUTER; ppidl = SHBrowseForFolder(&bi); //SHGetSpecialFolderPath(NULL, szNetworkHoodFolder, CSIDL_NETHOOD, FALSE); if ( ppidl != 0 ) { // get the name of the folder TCHAR path[MAX_PATH]; if ( SHGetPathFromIDList ( ppidl, path ) ) { MessageBox(path); } // free memory used IMalloc * imalloc = 0; if ( SUCCEEDED( SHGetMalloc ( &imalloc )) ) { imalloc->Free ( ppidl ); imalloc->Release ( ); } }
-
Ich setze pidlRoot vor dem Aufruf auf den Wert, den
SHGetSpecialFolderLocation(bi.hwndOwner,CSIDL_NETWORK,...)liefert
-
Ok, hat geklappt!
