![]() |
Dialog zum Auswählen von Computern im Netzwerk anzeigen
marabu hat
![]()
Delphi-Quellcode:
Aufgerufen wird das ganze dann folgendermaßen:
uses ShlObj, ActiveX;
... function FindComputer(sPrompt: string; csidl: word; var sComputer: string): boolean; const eMsg = 'Suchdialog konnte nicht geöffnet werden.'; var bi: TBrowseInfo; ca: array [0..MAX_PATH] of char; pidl, pidlSelected: PItemIDList; m: IMalloc; begin if Failed(SHGetSpecialFolderLocation(Application.Handle, csidl, pidl)) then raise Exception.Create(eMsg); try FillChar(bi, SizeOf(bi), 0); with bi do begin hwndOwner := Application.Handle; pidlRoot := pidl; pszDisplayName := ca; lpszTitle := PChar(sPrompt); ulFlags := BIF_BROWSEFORCOMPUTER; end; pidlSelected := SHBrowseForFolder(bi); Result := Assigned(pidlSelected); if Result then sComputer := String(ca); finally if Succeeded(SHGetMalloc(m)) then m.Free(pidl); end; end;
Delphi-Quellcode:
gruss
procedure TForm1.Button1Click(Sender: TObject);
var sMachine: string; begin if FindComputer('Wählen Sie einen Computer aus:', CSIDL_NETWORK, sMachine) then Edit1.Text := sMachine; end; [edit=CalganX]Titel angepasst. Mfg, CalganX[/edit] |
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:42 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz