unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ShellAPI, StdCtrls, ShlOBJ;
type
TForm1 =
class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
Info: ShellExecuteInfo;
List: PItemIDList;
begin
SHGetSpecialFolderLocation(GetActiveWindow, CSIDL_DRIVES, List);
ZeroMemory(@Info, SizeOf(ShellExecuteInfo));
Info.cbSize := SizeOf(ShellExecuteInfo);
Info.lpVerb := '
explore';
//Diese Zeile kannst du auch entfernen, wenn du die TreeView anzeige nicht haben möchtest...
Info.Wnd := GetActiveWindow;
Info.fMask := SEE_MASK_IDLIST;
Info.lpIDList := List;
Info.nShow := SW_SHOWMAXIMIZED;
//auch veränderbar ;-)
ShellExecuteEx(@Info)
end;
end.