SHQueryRecycleBinA function

Retrieves the size of the Recycle Bin and the number of items in it, for a specified drive.

Syntax

SHSTDAPI SHQueryRecycleBinA(
  LPCSTR          pszRootPath,
  LPSHQUERYRBINFO pSHQueryRBInfo
);

Parameters

pszRootPath

Type: LPCTSTR

The address of a null-terminated string of maximum length MAX_PATH to contain 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 (C:\Windows\System...).

pSHQueryRBInfo

Type: LPSHQUERYRBINFO

The address of a SHQUERYRBINFO structure that receives the Recycle Bin information. The cbSize member of the structure must be set to the size of the structure before calling this API.

Return Value

Type: HRESULT

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

With Windows 2000, if NULL is passed in the pszRootPath parameter, the function fails and returns an E_INVALIDARG error code. In earlier versions of the operating system, you can pass an empty string or NULL. If pszRootPath contains an empty string or NULL, information is retrieved for all Recycle Bins on all drives.

Requirements

   
Windows version Windows 2000 Professional, Windows XP [desktop apps only] Windows 2000 Server [desktop apps only]
Target Platform Windows
Header shellapi.h
Library Shell32.lib
DLL Shell32.dll (version 4.71 or later)

See Also

SHEmptyRecycleBin