0 out of 1 rated this helpful - Rate this topic

SHQueryRecycleBin function

Applies to: desktop apps only

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

Minimum supported server

Windows 2000 Server

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

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ