WINDOWS的浏览文件夹对话框

//SelectDirectory在Delphi中定位文件夹位置  

function SelectDirectory(var Directory: string; Options: TSelectDirOpts; HelpCtx: Longint): Boolean;
function SelectDirectory(const Caption: string; const Root: WideString; var Directory: string): Boolean;


uses FileCtrl;
procedure TForm1.Button1Click(Sender: TObject);
var
  sDir:string;
begin
  if SelectDirectory('Path','',sDir) then
  begin
     ComboBox1.Text:=sDir;
  end;
end;


uses FileCtrl;
procedure TForm1.Button1Click(Sender: TObject);
var
  sDir:string;
  const   SELDIRHELP = 1000;
begin
  if SelectDirectory(sDir,[sdAllowCreate, sdPerformCreate, sdPrompt],SELDIRHELP) then
  begin
     ComboBox1.Text:=sDir;
  end;
end;







原文地址:https://www.cnblogs.com/xe2011/p/2531622.html