JCL Help:SHEnumFolderFirst

From Project JEDI Wiki
Jump to navigationJump to search


Begins the enumeration of the items in a folder.


 function SHEnumFolderFirst(const Folder: string; Flags: TEnumFolderFlags; var F: TEnumFolderRec): Boolean;


Parameters Description
const Folder: string Fully qualified name of the folder you want to enumerate.
Flags: TEnumFolderFlags Flags that determine what type of items to include in the enumeration.
var F: TEnumFolderRec Record that returns information about the items found and holds data used to continue the enumeration with a later call the SHEnumFolderNext.
SpecialFolder One of the CSIDL_XXX constants that identify the special folder to enumerate.

Return Value

If the function succeeds it returns True and the TypesTEnumFolderRec record is filled with information about the first found item. If the function fails the return value is False. In this latter case you cannot call SHEnumFolderNext and don't need to call SHEnumFolderClose. If the function succeeded you can continue the enumeration with SHEnumFolderNext


SHEnumFolderFirst begins the enumeration of all items in the specified folder that match the specified Flags. If the function succeeds then the return value is True and the F parameter will contain information about the found item such as its name and attributes. To continue the enumeration call SHEnumFolderNext. To close the enumeration and release the resources held call SHEnumFolderClose. If the function fails the return value is False. This might indicate an error such as a non-existing function, or indicate that the folder is empty. The flags parameter allows you to put a number of restrictions on the items that are included in the enumeration. To define the folder to enumeration use the Folder string parameter, supply a fully qualified path, or the SpecialFolder parameter which can be set to one of the CSIDL_XXX constants.

See Also

SHEnumFolderNext SHEnumFolderClose TEnumFolderRec





Marcel van Brakel


If SHEnumFolderFirst returns False there is no need to call SHEnumFolderClose. Passing an empty string as the Folder parameter will enumerate 'My Computer'.

Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page