Microsoft Windows CE 3.0  

FindFirstFile

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This function searches a directory for a file or subdirectory whose name matches the specified file name.

A remote application interface (RAPI) version of this function exists and it is named CeFindFirstFile.

HANDLE
FindFirstFile(
LPCTSTR
lpFileName
,
LPWIN32_FIND_DATA
lpFindFileData
);

Parameters

lpFileName
[in] Pointer to a null-terminated string that specifies a valid directory or path and filename, which can contain wildcard characters (* and ?).

There is a default string size limit for paths of MAX_PATH characters. This limit is related to how the FindFirstFilefunction parses paths.

lpFindFileData
[out] Pointer to the WIN32_FIND_DATAstructure that receives information about the found file or subdirectory.

Return Values

A search handle, used in a subsequent call to FindNextFileor FindClose, indicates success. INVALID_HANDLE_VALUE indicates failure. To get extended error information, call GetLastError.

Remarks

The FindFirstFilefunction opens a search handle and returns information about the first file whose name matches the specified pattern. Once the search handle is established, you can use the FindNextFilefunction to search for other files that match the same pattern. When the search handle is no longer needed, close it by using the FindClosefunction.

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

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later Winbase.h   Coredll.lib, Fsmain.lib
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

CeFindFirstFile, FindClose, FindNextFile, GetFileAttributes, GetLastError, SetFileAttributes, WIN32_FIND_DATA