FindFirstProjectFile

This function searches a directory for a file whose name matches the specified file name. It can also examine subdirectories and flash cards.

At a Glance

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

Syntax

HANDLE FindFirstProjectFile(LPCTSTR lpFileName,
LPWIN32_FIND_DATA
lpFindFileData, DWORD dwOidFlash,
LPTSTR
lpszProj);

Parameter

lpFileName
Long pointer to the file name to search for, for example, “*.wav.”
lpFindFileData
Long points to the WIN32_FIND_DATA structure that receives information about the found file or subdirectory.
dwOidFlash
Specifies the object identifier of the specified mountable file system. The application can obtain this identifier using FindFirstFlashCard or FindNextFlashCard. If the identifier is zero, FindFirstProjectFile searches the main memory for the first project file in the specified folder.
lpszProj
Long pointer to the null-terminated string that contains the name of the target folder. If lpszProj is set to NULL, the function searches for files in the My Documents folder.

Return Values

If the function succeeds, the return value is a search handle used in a subsequent call to FindNextProjectFile or FindClose. If the function fails, the return value is INVALID_HANDLE_VALUE. To get extended error information, call GetLastError.

Remarks

The FindFirstProjectFile function opens a search handle and returns information about the first file whose name matches the specified pattern. Once the search handle is established, use the FindNextProjectFile function to search for other files that match the same pattern. When the search handle is no longer needed, close it by calling the FindClose function.

This function searches for files by name only; it cannot be used for attribute-based searches.

FindFirstProjectFile replaces FindFirstFile for the Palm-size PC.

See Also

FindClose, FindFirstFlashCard, FindNextFlashCard, FindNextProjectFile, WIN32_FIND_DATA