Compartir a través de


GetFileVersionInfo (Compact 2013)

3/26/2014

This function returns version information about a specified file.

Syntax

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

Parameters

  • lptstrFilename
    [in] Pointer to a null-terminated string that contains the name of the file specified.
  • dwHandle
    Ignored.
  • dwLen
    [in] 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 file 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 version information to the size of the buffer.

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

    Use this value in a subsequent call to the VerQueryValue function to obtain data from the buffer.

    The file version information is always in Unicode format.

Return Value

Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.

Remarks

The version information functions are only compatible with 32-bit Windows file images. They are not compatible with 16-bit Windows file images.

Call the GetFileVersionInfoSize function before calling this function.

The file-version information has the format indicated by the VS_VERSIONINFO structure.

Requirements

Header

winbase.h

Library

coredll.lib

See Also

Reference

File I/O Functions
GetFileVersionInfoSize

Other Resources

VerQueryValue
VS_VERSIONINFO