Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to call Windows Explorer Browser Dialog. Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
Call Windows Explorer Browser Dialog. 04-Jan-05
Category
Shell API
Language
Delphi All Versions
Views
339
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
Darley, F. Joe
Reference URL:
			
1   
2   //this code will display the windows Explorer Browser Dialog
3   
4   unit Unit1;
5   
6   interface
7   
8   uses
9     Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
10    StdCtrls, FileCtrl,ShlObj;
11  
12  type
13    TForm1 = class(TForm)
14      Button1: TButton;
15      dlb: TDirectoryListBox;
16      procedure Button1Click(Sender: TObject);
17    private
18      { Private declarations }
19    public
20      { Public declarations }
21    end;
22  
23  var
24    Form1: TForm1;
25  
26  implementation
27  
28  {$R *.DFM}
29  
30  
31  function BrowseForFolder: string;
32  var
33  lpItemID: PItemIDList;
34  BrowseInfo: TBrowseInfo;
35  
36    DisplayName: array[0..MAX_PATH] of char;
37    TempPath: array[0..MAX_PATH] of char;
38  begin
39      FillChar(BrowseInfo, sizeof(TBrowseInfo), #0);
40      with BrowseInfo do
41        begin
42        hwndOwner := Application.Handle;
43        pszDisplayName := @DisplayName;
44        lpszTitle := PChar('');
45        ulFlags := BIF_RETURNONLYFSDIRS;
46        end;
47      lpItemID := SHBrowseForFolder(BrowseInfo);
48      if lpItemId <> nil then
49        begin
50        SHGetPathFromIDList(lpItemID, TempPath);
51        GlobalFreePtr(lpItemID);
52        Result := TempPath;
53        end
54      else
55        Result := '';
56  
57  end;
58  procedure TForm1.Button1Click(Sender: TObject);
59  begin
60  dlb.Directory:=BrowseForFolder;
61  end;
62  
63  end.


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC