SHEmptyRecycleBinW function (shellapi.h)
Empties the Recycle Bin on the specified drive.
SHSTDAPI SHEmptyRecycleBinW( [in, optional] HWND hwnd, [in, optional] LPCWSTR pszRootPath, DWORD dwFlags );
[in, optional] hwnd
A handle to the parent window of any dialog boxes that might be displayed during the operation. This parameter can be NULL.
[in, optional] 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.
One or more of the following values.
No dialog box confirming the deletion of the objects will be displayed.
No dialog box indicating the progress will be displayed.
No sound will be played when the operation is complete.
If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
The shellapi.h header defines SHEmptyRecycleBin as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
|Minimum supported client||Windows 2000 Professional, Windows XP [desktop apps only]|
|Minimum supported server||Windows 2000 Server [desktop apps only]|
|DLL||Shell32.dll (version 4.71 or later)|
|API set||ext-ms-win-shell-shell32-l1-2-2 (introduced in Windows 10, version 10.0.14393)|