Solved

Browse Dialog

Posted on 1997-07-08
3
285 Views
Last Modified: 2010-04-06
Sometime in software, we see a browse dialog that enable us to chose a folder, not a file like open dialog do. So, I want to know how to call that dialog within delphi 3.
0
Comment
Question by:fmichaud061597
3 Comments
 
LVL 5

Expert Comment

by:ronit051397
ID: 1338491
use the SHBrowseForFolder to Displays a dialog box that enables the user to select a folder
see API documentation.
0
 

Author Comment

by:fmichaud061597
ID: 1338492
I'd like to have an example on how to use it, and what unit declares that procedure.
0
 
LVL 3

Accepted Solution

by:
sperling earned 50 total points
ID: 1338493
Here's a part of an util of mine using ShBrowseForFolder.

----
uses
  .....

  ShlObj, ActiveX;


procedure TForm1.ButtonBrowseClick(Sender: TObject);
var
  bi      : TBrowseInfo;
  idl     : POINTER;
  im      : IMAlloc;
begin
  Application.NormalizeTopMosts;
  with bi do begin
    hWndOwner := Handle;
    pidlRoot := nil;
    pszDisplayName := StrAlloc(MAX_PATH);
    lpszTitle := 'Select IIS Log file folder';
    ulFlags := BIF_RETURNONLYFSDIRS;
    lpfn := nil;
    lParam := 0;
    iImage := 0;
  end;
  idl := ShBrowseForFolder ( bi );
  Application.RestoreTopMosts;
  if idl<>nil then begin
    ShGetPathFromIDList(idl, bi.pszDisplayName);
    EditLogDir.Text := StrPas(bi.pszDisplayName);
  end;
  StrDispose(bi.pszDisplayName);
  ShGetMalloc(im);
  im.Free(idl);
end;
----

Regards,

Erik.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now