Επεξεργασία

Κοινή χρήση μέσω


IShellFolder interface (shobjidl_core.h)

Exposed by all Shell namespace folder objects, its methods are used to manage folders.

Inheritance

The IShellFolder interface inherits from the IUnknown interface. IShellFolder also has these types of members:

Methods

The IShellFolder interface has these methods.

 
IShellFolder::BindToObject

Retrieves a handler, typically the Shell folder object that implements IShellFolder for a particular item. Optional parameters that control the construction of the handler are passed in the bind context.
IShellFolder::BindToStorage

Requests a pointer to an object's storage interface.
IShellFolder::CompareIDs

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

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

Enables 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.
IShellFolder::GetAttributesOf

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

Retrieves the display name for the specified file object or subfolder.
IShellFolder::GetUIObjectOf

Gets an object that can be used to carry out actions on the specified file objects or folders.
IShellFolder::ParseDisplayName

Translates the display name of a file object or a folder into an item identifier list.
IShellFolder::SetNameOf

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

Remarks

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.

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 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.

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.
 

Examples

An example implementation of IShellFolder can be seen in the Explorer Data Provider Sample sample. The use of various IShellFolder methods can be found in several samples, including File Operations Sample.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header shobjidl_core.h