Hello SageHermit, you wrote:
> Как открыть окно проводника с Корзиной средствами WinAPI ?
SHGetSpecialFolderPath получаем путь к папке.
Затем делаем ShellExecute.
--
Всего хорошего, Слава
http://slava.users.otts.ruPosted via RSDN NNTP Server 1.9 gamma
Hello SageHermit, you wrote:
> Я так уже пробовал, эта функция не работает с CSIDL_BITBUCKET, в MSDN
> написано:
> If a virtual folder is specified, this function will fail.
Вот решение от Петера Белова:
> Can anyone tell me how to programatically open the folders that display
> the contents of the Network Neighborhood, My Computer and Recycle bin
> folders?
>
Procedure FreePidl( pidl: PItemIDList );
Var
allocator: IMalloc;
Begin
If Succeeded(SHGetMalloc(allocator)) Then Begin
allocator.Free(pidl);
{$IFDEF VER90}
allocator.Release;
{$ENDIF}
End;
End;
procedure TForm1.ButtonClick(Sender: TObject);
var
exInfo: TShellExecuteInfo;
Begin
FillChar( exInfo, Sizeof(exInfo), 0 );
// initialize all fields to 0
With exInfo Do Begin
cbSize:= Sizeof( exInfo ); // required!
fMask := SEE_MASK_FLAG_DDEWAIT or SEE_MASK_IDLIST;
Wnd := Handle;
nShow := SW_SHOWNORMAL;
lpVerb := 'open';
ShGetSpecialFolderLocation( handle, CSIDL_DRIVES ,
PItemIDLIst(lpIDList ));
End;
ShellExecuteEx( @exInfo );
FreePIDL( exinfo.lpIDList );
end;
Needs a bit more error checking but should show the principle. Look at
the entry for ShGetSpecialFolderLocation in win32.hlp to see which
indices to use for other folders.
--
Всего хорошего, Слава
http://slava.users.otts.ruPosted via RSDN NNTP Server 1.9 gamma