uses ShellAPI;

//打开 C 盘
procedure TForm1.Button1Click(Sender: TObject);
begin
  ShellExecute(Handle, 'open', 'Explorer.exe', 'C:\', nil, SW_SHOWNORMAL);
end;

//打开 我的电脑
procedure TForm1.Button2Click(Sender: TObject);
begin
  ShellExecute(Handle, 'open', 'Explorer.exe',
    '::{20D04FE0-3AEA-1069-A2D8-08002B30309D}', nil, SW_SHOWNORMAL);
end;

//打开 资源管理器
procedure TForm1.Button3Click(Sender: TObject);
begin
  ShellExecute(Handle, 'open', 'Explorer.exe',
    '/e,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}', nil, SW_SHOWNORMAL);
end;

posted on 2009-12-09 13:19  万一  阅读(3443)  评论(7编辑  收藏  举报