FindFirstFileEx

This function searches a directory for a file whose name and attributes match those specified in the function call.

HANDLE FindFirstFileEx(
  LPCTSTR lpFileName, 
  FINDEX_INFO_LEVELS fInfoLevelId, 
  LPVOID lpFindFileData, 
  FINDEX_SEARCH_OPS fSearchOp, 
  LPVOID lpSearchFilter, 
  DWORD dwAdditionalFlags 
);

Parameters

  • lpFileName
    [in] Points to a null-terminated string that specifies a valid directory or path and filename, which can contain wildcard characters (* and ?).
  • fInfoLevelId
    [in] FINDEX_INFO_LEVELS enumeration type that gives the information level of the returned data.
  • lpFindFileData
    [out] Pointer to a WIN32_FIND_DATA structure.
  • fSearchOp
    [in] FINDEX_SEARCH_OPS enumeration type that gives the type of filtering to perform beyond wildcard matching.
  • lpSearchFilter
    [in] Pointer that must be NULL.
  • dwAdditionalFlags
    [in] Unsupported; set to zero.

Return Values

If the function succeeds, the return value is a search handle that can be used in a subsequent call to the FindNextFile or FindClose functions.

If the function fails, the return value is INVALID_HANDLE_VALUE. To get extended error information, call GetLastError.

Remarks

The FindFirstFileEx function is provided to open a search handle and return information about the first file whose name matches the specified pattern and attributes. File name searches are not case sensitive.

If the underlying file system does not support the specified type of filtering, other than directory filtering, FindFirstFileEx fails with the error ERROR_NOT_SUPPORTED. The application has to use FINDEX_SEARCH_OPS type FileExSearchNameMatch and perform its own filtering.

Once established, the search handle can be used in the FindNextFile function to search for other files that match the same pattern with the same filtering being performed. When the search handle is no longer needed, it should be closed using the FindClose function.

The following calls to FindFirstFileEx and FindFirstFile are equivalent.

FindFirstFileEx( lpFileName, 
                 FindExInfoStandard, 
                 lpFindData, 
                 FindExSearchNameMatch, 
                 NULL, 
                 0 );
FindFirstFile( lpFileName, lpFindData);

Requirements

OS Versions: Windows CE 3.0 and later.
Header: Winbase.h.
Link Library: Coredll.lib.

See Also

FindClose | FindFirstFile | FindNextFile | FINDEX_INFO_LEVELS | FINDEX_SEARCH_OPS | WIN32_FIND_DATA

 Last updated on Friday, April 09, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.