Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
Windows Shell
Shell Reference
Shell Functions
 SHEmptyRecycleBin Function

  Switch on low bandwidth view
SHEmptyRecycleBin Function

Empties the Recycle Bin on the specified drive.

Syntax

HRESULT SHEmptyRecycleBin(      
    HWND hwnd,     LPCTSTR pszRootPath,     DWORD dwFlags );

Parameters

hwnd
A handle to the parent window of any dialog boxes that might be displayed during the operation. This parameter can be NULL.
pszRootPath
The address of a null-terminated string of maximum length MAX_PATH that contains the path of the root drive on which the Recycle Bin is located. This parameter can contain the address of a string formatted with the drive, folder, and subfolder names, for example c:\windows\system\. It can also contain an empty string or NULL. If this value is an empty string or NULL, all Recycle Bins on all drives will be emptied.
dwFlags
One or more of the following values.
SHERB_NOCONFIRMATION
No dialog box confirming the deletion of the objects will be displayed.
SHERB_NOPROGRESSUI
No dialog box indicating the progress will be displayed.
SHERB_NOSOUND
No sound will be played when the operation is complete.

Return Value

Returns S_OK if successful, or a COM-defined error value otherwise.

Function Information

Minimum DLL Versionshell32.dll version 4.71 or later
Custom ImplementationNo
Headershellapi.h
Import libraryshell32.lib
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0
UnicodeImplemented as ANSI and Unicode versions.

See Also

SHQueryRecycleBin
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker