GetFileVersionInfo

This function returns version information about a specified file.

BOOL GetFileVersionInfo(
LPTSTR lptstrFilename,
DWORD dwHandle,
DWORD dwLen,
LPVOID lpData);

Parameters

  • lptstrFilename
    [in] Pointer to a null-terminated string that specifies the name of the file of interest.

  • dwHandle
    This parameter is ignored.

  • dwLen
    [in] Specifies the size, in bytes, of the buffer pointed to by the lpData parameter.

    Call the GetFileVersionInfoSize function first to determine the size, in bytes, of a file's version information. The dwLen parameter should be equal to or greater than that value.

    If the buffer pointed to by lpData is not large enough, the function truncates the file's version information to the size of the buffer.

  • lpData
    [out] Pointer to a buffer that receives the file-version information.

    You can use this value in a subsequent call to the VerQueryValue function to retrieve data from the buffer.

    The file version information is always in Unicode format.

Return Values

If the function succeeds, the return value is nonzero.

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

Remarks

The version information functions work only with Win32 file images. They do not work with 16-bit Windows file images.

Call the GetFileVersionInfoSize function before calling the GetFileVersionInfo function. The file-version information has the format indicated by the VS_VERSIONINFO structure

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 3.0 and later Winbase.h    

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

GetFileVersionInfoSize, GetLastError, VerQueryValue, VS_VERSIONINFO

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.