随笔 - 2146  文章 - 97 评论 - 11767 trackbacks - 253


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  万一  阅读(...)  评论(...编辑  收藏