EnumProjectsFiles

This function enumerates files within a folder or all folders in main memory or on a mountable file system, such as a flash card.

At a Glance

Header file: Projects.h
Windows CE Versions: 2.01 and later

Syntax

int EnumProjectsFiles(PROJECTSFILES_ENUMPROC lpEnumProc, DWORD dwOidFlash, DWORD dwFlags, LPTSTR lpszProj,
LPTSTR lpszFileName, LPARAM lParam);

Parameter

lpEnumProc
Long pointer to a callback function of the following prototype:

BOOL CALLBACK EnumProjects(DWORD dwOid, LPARAM lParam);

If this pointer is set to NULL, EnumProjectsFiles only returns the number of files.

dwOidFlash
Specifies the object identifier of the specified mountable file system.
dwFlags
Specifies the valid flags. It is one or a combination of the following values:
PRJ_ENUM_MEMORY
Enumerate files in main memory only. The dwOidFlash parameter is ignored.
PRJ_ENUM_FLASH
Enumerate files on the specified flash card only. The dwOidFlash parameter is the object identifier of the flash card returned from a previous call to FindFirstFlashCard or FindNextFlashCard.
PRJ_ENUM_ALL_DEVICES
Enumerate files in main memory and flash cards. The dwOidFlash parameter is ignored.
PRJ_ENUM_ALL_PROJ
Enumerate all files. The lpszProj parameter is ignored.

PRJ_ENUM_FLASH and PRJ_ENUM_ALL_DEVICES values should not be used together.

lpszProj
Long pointer to the null-terminated string that contains the file name to search for. If this parameter is set to NULL, the function enumerates all files under the My Document folder.
lpszFileName
Long pointer to the null-terminated string that contains the name or type of file to search for, for example, “*.*” or “mysound.wav.”
lParam
User-defined parameter passed to lpEnumProc. Use this parameter to pass information into the callback function.

Return Values

The number of files enumerated indicates success. If there are no files to enumerate, EnumProjectsFiles returns a zero. If lpEnumProc is NULL, EnumProjectsFiles still returns the number of folders.

Remarks

Use the callback function to perform any operations within the enumerated folders—for example, to pass out the name of each file, and then display all these names in a dialog box. The callback function returns FALSE to stop enumeration. This callback function is not the same as the callback function listed in EnumProjects.

To enumerate the files on a flash card, first call FindFirstFlashCard and FindNextFlashCard to locate the object identifier (OID) of the flash card. Enumerate folders using EnumProjects.

See Also

EnumProjects, FindFirstFlashCard, FindNextFlashCard