FindFirstProjectFile

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

Syntax

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

Parameters

  • lpFileName
    [in] Long pointer to the file name to search for — for example, *.wav.
  • lpFindFileData
    [out] Long pointer to the WIN32_FIND_DATA structure that receives information about the found file or subdirectory.
  • dwOidFlash
    [in] 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
    [in] 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. After 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 is the Windows Mobile replacement for the Windows CE function FindFirstFile.

Requirements

Pocket PC: Windows Mobile 2000 and later
OS Versions: Windows CE 3.0 and later
Header: projects.h
Library: note_prj.lib

See Also

WIN32_FIND_DATA and FindClose in the Microsoft Windows CE .NET 4.2 help system.

File and Application Management API Functions

FindFirstFlashCard

FindNextFlashCard

FindNextProjectFile

Send feedback on this topic to the authors.

© 2005 Microsoft Corporation. All rights reserved.