ShlObj, ShellAPI
var
Folder: Integer;
//
procedure TForm1.Button1Click(Sender: TObject);
var
MyItemIDList: PItemIDList;
MyShellEx: TShellExecuteInfo;
begin
SHGetSpecialFolderLocation(Form1.Handle, Folder, MyItemIDList);
with MyShellEx do
begin
cbSize:=Sizeof(MyShellEx);
fMask:=SEE_MASK_IDLIST;
Wnd:=Handle;
lpVerb:=nil;
lpFile:=nil;
lpParameters:=nil;
lpDirectory:=nil;
nShow:=SW_SHOWNORMAL;
hInstApp:=0;
lpIDList:=MyItemIDList;
end;
ShellExecuteEx(@MyShellEx);
end;
procedure TForm1.ComboBox1Change(Sender: TObject);
begin
case ComboBox1.ItemIndex of
0: Folder:=CSIDL_DRIVES;
1: Folder:=CSIDL_CONTROLS;
2: Folder:=CSIDL_DESKTOP;
3: Folder:=CSIDL_BITBUCKET;
end;
end;
procedure TForm1.FormActivate(Sender: TObject);
begin
Folder:=CSIDL_DRIVES;
end;
Das ist eine Beispiel Liste von Systemordner :
CSIDL_DESKTOP = $0000;
CSIDL_INTERNET = $0001;
CSIDL_PROGRAMS = $0002;
CSIDL_CONTROLS = $0003;
CSIDL_PRINTERS = $0004;
CSIDL_PERSONAL = $0005;
CSIDL_FAVORITES = $0006;
CSIDL_STARTUP = $0007;
CSIDL_RECENT = $0008;
CSIDL_SENDTO = $0009;
CSIDL_BITBUCKET = $000a;
CSIDL_STARTMENU = $000b;
CSIDL_DESKTOPDIRECTORY = $0010;
CSIDL_DRIVES = $0011;
CSIDL_NETWORK = $0012;
CSIDL_NETHOOD = $0013;
CSIDL_FONTS = $0014;
CSIDL_TEMPLATES = $0015;
CSIDL_COMMON_STARTMENU = $0016;
CSIDL_COMMON_PROGRAMS = $0017;
CSIDL_COMMON_STARTUP = $0018;
CSIDL_COMMON_DESKTOPDIRECTORY = $0019;
CSIDL_APPDATA = $001a;
CSIDL_PRINTHOOD = $001b;
CSIDL_ALTSTARTUP = $001d; // DBCS
CSIDL_COMMON_ALTSTARTUP = $001e; // DBCS
CSIDL_COMMON_FAVORITES = $001f;
CSIDL_INTERNET_CACHE = $0020;
CSIDL_COOKIES = $0021;
CSIDL_HISTORY = $0022;
Keine Kommentare:
Kommentar veröffentlichen