An application that uses the IShellFolder interface for a folder can determine the folder's contents by using the EnumObjects member function. This member function creates an item enumeration object, which is a set of item identifiers that can be retrieved by using the IEnumIDList interface.
One or more item identifiers can be retrieved from the enumeration object by using the IEnumIDList::Next member function. Calling this function repeatedly allows an application to retrieve all of the item identifiers one or more at a time. Using other member functions, you can skip items in the sequence, return to the beginning of the sequence, or "clone" the enumeration object to save its state.
When you are finished using the enumeration object, you must free it by calling the IEnumIDList::Release member function.