SHQueryRecycleBin function

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

Syntax


HRESULT SHQueryRecycleBin(
  _In_opt_ LPCTSTR         pszRootPath,
  _Inout_  LPSHQUERYRBINFO pSHQueryRBInfo
);

Parameters

pszRootPath [in, optional]

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 [in, out]

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

Minimum supported client

Windows 2000 Professional, Windows XP [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Shellapi.h

Library

Shell32.lib

DLL

Shell32.dll (version 4.71 or later)

Unicode and ANSI names

SHQueryRecycleBinW (Unicode) and SHQueryRecycleBinA (ANSI)

See also

SHEmptyRecycleBin

 

 

Show: