uses
ActiveX, ShlObj, ShellApi;
procedure TForm1.Button1Click(Sender: TObject);
var
info: TShellExecuteInfo;
allc: IMalloc;
begin
zeromemory(@info, SizeOf(info));
with info do begin
cbSize := SizeOf(info);
fMask := SEE_MASK_FLAG_DDEWAIT or SEE_MASK_IDLIST;
Wnd := Handle;
nShow := SW_RESTORE;
lpVerb := 'open';
ShGetSpecialFolderLocation(Handle, CSIDL_BITBUCKET, PItemIDLIst(lpIDList));
end;
ShellExecuteEx(@info);
if Succeeded(shlobj.SHGetMalloc(allc)) then
allc.Free(info.lpIDList);
end;