Compartilhar via


IShellFolder (Compact 2013)

3/28/2014

This interface manages folders. All shell namespace folder objects expose this interface.

Methods

Like all COM interfaces, this interface inherits the methods for the IUnknown interface.

Remarks

Use this interface when you need to display or perform an operation on the contents of the shell's namespace. Other shell folder objects usually create objects that support IShellFolder.

IShellFolder methods only accept pointers to item identifier lists (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 receive PIDLs of this form. Other methods, such as IShellFolder::CompareIDs, accept multilevel 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 which type of PIDL can be accepted by a particular method.

When to Implement

Implement this interface for objects that extend the shell's namespace. For example, implement this interface to create a separate namespace that requires a rooted Windows Explorer or to install a new namespace directly within the hierarchy of the system namespace. You are most familiar with the contents of your namespace, so you are responsible for implementing everything needed to access your data.

Obtaining a Pointer

To retrieve a folder's IShellFolder interface, you typically 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.

Requirements

Header

shobjidl.h,
shobjidl.idl

Library

Developer Implemented

See Also

Reference

Shell Interfaces
SHITEMID
SHGetDesktopFolder