Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
function SelectDirectory(const Caption; const Root : widestring; out Directory: string): boolean;
SelectDirectory function brings up a dialog box ready for the user to select a directory name.
SelectDirectory function is an encapsulation of the BrowseForFolder Windows API function.
The dialog box includes an "OK" and a "Cancel" button, if the user presses the "Cancel" button the function returns False. If the user presses the "OK" button the function returns the directory selected in a Directory parameter. When the dialog is displayed it uses the Root parameter as the directory from which to browse. Caption is the message of the dialog, not the caption, the dilaog caption is "Browse For Folder".
var dir : widestring;
if SelectDirectory('My message','d:\!gajba',dir) then
showmessage('Folder selected ' + dir);
|
Browse for Computers, Folders, Files and Printers
Use Delphi (and API) to display the directory structure of a computer and allow a user to select a folder without using the Common Dialog control. Plus: select a printer or network computer.
DirectoryExists,InputBox, InputQuery
|
Free Delphi code snippet inside every Delphi Newsletter! |
|
|
|
Got some code to share? Got a question? Need some help? |
|
|