Solved

Browse Dialog

Posted on 1997-07-08
3
289 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

820 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