您现在的位置:首页 >> 基础算法 >> window基础 >> 内容

Delphi中用ShellExecuteEx打开Recycle Bin

时间:2011/9/3 15:30:57 点击:

  核心提示:usesShlObj, ShellAPI, ... ; Place a TButton named 'OpenBinButton' on a form, handle its OnClick even...
uses
  ShlObj, ShellAPI, ... ;

Place a TButton named "OpenBinButton" on a form, handle its OnClick event as:

procedure TRecycleBinForm.OpenBinButtonClick(Sender: TObject) ;
var
   recycleBinPIDL: PItemIDList;
   execInfo: TShellExecuteInfo;
begin
   SHGetSpecialFolderLocation(Handle, CSIDL_BITBUCKET, recycleBinPIDL) ;
   with execInfo do
   begin
     cbSize := Sizeof(execInfo) ;
     fMask := SEE_MASK_IDLIST;
     Wnd := Handle;
     lpVerb := nil;
     lpFile := nil;
     lpParameters := nil;
     lpDirectory := nil;
     nShow := SW_SHOWNORMAL;
     hInstApp:=0;
     lpIDList := recycleBinPIDL;
   end;
   ShellExecuteEx(@execInfo) ;
end;

Tags:中用 打开 
作者:站长 来源:转载
共有评论 0相关评论
发表我的评论
  • 大名:
  • 内容:
  • 盒子文章(www.2ccc.com) © 2022 版权所有 All Rights Reserved.
  • 沪ICP备05001939号