Home COM GDI+ WebBrowser Data Access

IShellFolder Interface

 

IID_IShellFolder

{000214E6-0000-0000-C000-000000000046}

 

 

The IShellFolder interface is used to manage folders. It is exposed by all Shell namespace folder objects.

 

Use this interface when you need to display or perform an operation on the contents of the Shell's namespace. Objects that support IShellFolder are usually created by other Shell folder objects. To retrieve a folder's IShellFolder interface, you normally start by calling SHGetDesktopFolder. This function returns a pointer to the desktop's IShellFolder interface. You can then use its methods to retrieve an IShellFolder interface for a particular namespace folder.

 

Note  IShellFolder methods only accept PIDLs that are relative to the folder. Some IShellFolder methods, such as IShellFolder::GetAttributesOf, only accept single-level PIDLs. In other words, the PIDL must contain only a single SHITEMID structure, plus the terminating NULL. When you enumerate the contents of a folder with IEnumIDList, you will receive PIDLs of this form. Other methods, such as IShellFolder::CompareIDs, accept multi-level PIDLs. These PIDLs can have multiple SHITEMID structures and identify objects one or more levels below the parent folder. Check the reference to be sure what type of PIDL can be accepted by a particular method.

 

 

Methods in VTable order

IUnknown Methods

Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments reference count.

Release

Decrements reference count.

IShellFolder Methods

Description

ParseDisplayName

Translates a file object's or folder's display name into an item identifier list.

EnumObjects

Allows a client to determine the contents of a folder by creating an item identifier enumeration object and returning its IEnumIDList interface. The methods supported by that interface can then be used to enumerate the folder's contents.

BindToObject

Retrieves an IShellFolder object for a subfolder.

BindToStorage

Requests a pointer to an object's storage interface.

CompareIDs

Determines the relative order of two file objects or folders, given their item identifier lists.

CreateViewObject

Requests an object that can be used to obtain information from or interact with a folder object.

GetAttributesOf

Retrieves the attributes of one or more file or folder objects contained in the object represented by IShellFolder.

GetUIObjectOf

Retrieves an OLE interface that can be used to carry out actions on the specified file objects or folders.

GetDisplayNameOf

Retrieves the display name for the specified file object or subfolder.

SetNameOf

Sets the display name of a file object or subfolder, changing the item identifier in the process.

 

ParseDisplayName

 

FUNCTION IShellFolder_ParseDisplayName ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL hwnd AS DWORD _
, BYVAL pbc AS DWORD _
, BYVAL pszDisplayName AS STRING _
, BYREF pchEaten AS DWORD _
, BYREF ppidl AS DWORD _
, BYREF pdwAttributes AS DWORD _
  ) AS LONG

  LOCAL HRESULT AS LONG

  pwszDisplayName = UCODE$(pwszDisplayName & $NUL)
  CALL DWORD @@pthis[3] USING IShellFolder_ParseDisplayName (pthis,
hwnd, pbc, pwszDisplayName, pchEaten, ppidl, pdwAttributes) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

EnumObjects

 

FUNCTION IShellFolder_EnumObjects ( _
  BYVAL pthis AS DWORD PTR _
, BYBAL hwnd AS DWORD _
, BYVAL grfFlags AS LONG _
, BYREF ppenumIDList AS DWORD _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[4] USING IShellFolder_EnumObjects (pthis,
hwnd, grfFlags, ppenumIDList) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

BindToObject

 

FUNCTION IShellFolder_BindToObject ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL pidl AS DWORD _
, BYVAL pbc AS DWORD _
, BYREF riid AS GUID _
, BYREF ppv AS DWORD _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[5] USING IShellFolder_BindToObject (pthis, pidl, pbc, riid, ppv) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

BindToStorage

 

FUNCTION IShellFolder_BindToStorage ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL pidl AS DWORD _
, BYVAL pbc AS DWORD _
, BYREF riid AS GUID _
, BYREF ppv AS DWORD _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[6] USING IShellFolder_BindToStorage (pthis, pidl, pbc, riid, ppv) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

CompareIDs

 

FUNCTION IShellFolder_CompareIDs ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL lParam AS DWORD _
, BYVAL pidl1 AS DWORD _
, BYVAL pidl2 AS DWORD _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[7] USING IShellFolder_CompareIDs (pthis, lParam, pidl1, pidl2) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

CreateViewObject

 

FUNCTION IShellFolder_CreateViewObject ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL hwndOwner AS DWORD _
, BYREF riid AS GUID _
, BYREF ppv AS DWORD _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[8] USING IShellFolder_CreateViewObject (pthis, hwndOwner, riid, ppv) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

GetAttributesOf

 

FUNCTION IShellFolder_GetAttributesOf ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL cidl AS DWORD _
, BYVAL apidl AS DWORD _
, BYREF rgfInOut AS DWORD _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[9] USING IShellFolder_GetAttributesOf (pthis, cidl, apidl, rgfInOut) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

GetUIObjectOf

 

FUNCTION IShellFolder_GetUIObjectOf ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL hwndOwner AS DWORD _
, BYVAL cidl AS DWORD _
, BYVAL apidl AS DWORD _
, BYREF riid AS GUID _
, BYREF rgfReserved AS DWORD _
, BYREF ppv AS DWORD _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[10] USING IShellFolder_GetUIObjectOf (pthis, hwndOwner, cidl, apidl, riid, rgfReserved, ppv) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

GetDisplayNameOf

 

FUNCTION IShellFolder_GetDisplayNameOf ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL pidl AS DWORD _
, BYVAL uFlags AS DWORD _
, BYREF pName AS STRRET _
  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[11] USING IShellFolder_GetDisplayNameOf (pthis, pidl, uFlags, pName) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

SetNameOf

 

FUNCTION IShellFolder_SetNameOf ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL hwnd AS DWORD _
, BYVAL pidl AS DWORD _
, BYVAL pwszName AS STRING _
, BYVAL uFlags AS DWORD _
, BYREF pidlOut AS DWORD _
  ) AS LONG

  LOCAL HRESULT AS LONG

  pwszName = UCODE$(pwszName & $NUL)
  CALL DWORD @@pthis[12] USING IShellFolder_SetNameOf (pthis, hwnd, pidl, pwszName, uFlags, pidlOut) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

Page last updated on Friday, 11 August 2006 04:22:17 +0200