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 get Destkop folder location. 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
Get Desktop folder location. 03-Jun-04
Category
Shell API
Language
Delphi 5.x
Views
245
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
Darley, F. Joe
Reference URL:
			1   
2   unit Unit1;
3   
4   interface
5   
6   uses
7     Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
8     Dialogs, ShlObj, StdCtrls, FileCtrl;
9   
10  type
11    TForm1 = class(TForm)
12      Button1: TButton;
13      Edit1: TEdit;
14      FileListBox1: TFileListBox;
15      procedure Button1Click(Sender: TObject);
16    private
17      { Private declarations }
18    public
19      { Public declarations }
20    end;
21  
22  var
23    Form1: TForm1;
24  
25  implementation
26  
27  {$R *.dfm}
28  
29  
30  procedure TForm1.Button1Click(Sender: TObject);
31  var
32    pItem: PItemIDList;
33    Path: array [0..MAX_PATH-1] of char;
34  begin
35    {get location of destop folder}
36    if SHGetSpecialFolderLocation(Handle, CSIDL_DESKTOP , pItem) = NOERROR then
37    begin
38      SHGetPathFromIDList(pItem, Path);
39      FileListBox1.Directory:=path; // view files in the folder
40      caption:=path;
41    end;
42  end;
43  
44  
45  { Here is a list of Folder locations
46  
47    CSIDL_STARTMENU       Start menu Folder location
48    CSIDL_HISTORY         History folder location
49    CSIDL_INTERNET_CACHE  Internet cache folder location
50    CSIDL_COMMON_FAVORITES Favorates folder location
51    CSIDL_PRINTHOOD       Print Hood Folder Location
52    CSIDL_COMMON_DESKTOPDIRECTORY  Common Desktop folder location
53    CSIDL_DESKTOP         Desktop folder location
54    CSIDL_RECENT          Recent Folder Location
55    CSIDL_PERSONAL       My Documents folder location
56  }
57  
58  
59  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