网站首页  词典首页

请输入您要查询的函数:

 

术语 getfileversioninfo
释义 GetFileVersionInfo
语法:
BOOL GetFileVersionInfo( LPCTSTR lptstrFilename,
DWORD dwHandle,
DWORD dwLen,
LPVOID lpData
);
GetFileVersionInfo函数
检索指定文件的版本信息。
参数
lptstrFilename
[in]指向一个空结束的字符串,指定感兴趣的文件的名称。如果完全没有指定路径,该函数使用搜索序列的LoadLibrary函数指定。
在Windows 95/98/Me:在指定的文件名短路径的形式必须少于126个字符。
dwHandle
此参数被忽略。
dwLen
[in]指定的大小,以字节的缓冲区指向的lpData参数。
呼叫以字节为GetFileVersionInfoSize函数首先确定大小,一个文件的版本信息。在dwLen成员应等于或大于该值较大。
如果缓冲区指向lpData不够大,功能截断该文件的版本信息的缓冲区的大小。
lpData
[out]指向的缓冲区接收文件的版本信息。
您可以使用在随后的调用此值VerQueryValue函数来检索数据从缓冲区。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
Windows Vista的:文件版本信息的固定和非固定的一部分。固定部分包含版本号等信息。非固定部分包含字符串一样的东西。在过去的GetFileVersionInfo正在从二进制版本信息(exe文件/ DLL)中。目前,它是从语言查询中性文件(exe固定版本/ dll)和非固定的mui文件的一部分,合并这些机构和用户的回报。如果给定的二进制没有mui文件,然后行为是在以前的版本。
Windows NT 3.51和更早的版本:版本信息功能不使用16位Windows文件图像。
在Windows 95/98/Me:GetFileVersionInfoW是支持微软层对于Unicode。若要使用此版本,您必须添加一些文件到您的应用,概述了对Unicode的Microsoft层在Windows 95/98/Me系统。
Windows 95/98/Me中,Windows NT 4.0和Windows 2000中:这些问题都16 -和32位文件的图像功能的工作。
Windows XP中:16这些职能的工作- ,32 - ,和64位文件的图像。
调用联络,然后调用GetFileVersionInfo函数GetFileVersionInfoSize功能。从该文件中的信息,版本信息缓冲区,使用VerQueryValue函数。
功能信息
最低DLL版本 version.dll
在Winver.h HeaderDeclared,头文件:winuser.h
import libraryVersion.lib
最低操作系统Windows 95,Windows NT 3.1
UnicodeImplemented为ANSI和Unicode版本。
参见
版本信息概览,GetFileVersionInfoSize,VerQueryValue,VS_VERSIONINFO
==英文原文==GetFileVersionInfo Function
Retrieves version information for the specified file.
Syntax
BOOL GetFileVersionInfo( LPCTSTR 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. If a full path is not specified, the function uses the search sequence specified by the LoadLibrary function.
Windows 95/98/Me: The short path form of the specified file name must be less than 126 characters.
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 member 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.
Return Value
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
Windows Vista: File version info has fixed and non-fixed part. The fixed part contains information like version number. The non-fixed part contains things like strings. In the past GetFileVersionInfo was taking version information from the binary (exe/dll). Currently, it is querying fixed version from language neutral file (exe/dll) and the non-fixed part from mui file, merges them and returns to the user. If the given binary does not have a mui file then behavior is as in previous version.
Windows NT 3.51 and earlier: The version information functions do not work with 16-bit Windows file images.
Windows 95/98/Me: GetFileVersionInfoW is supported by the Microsoft Layer for Unicode. To use this version, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems .
Windows 95/98/Me, Windows NT 4.0 and Windows 2000: These functions work on both 16- and 32-bit file images.
Windows XP: These functions work on 16-, 32-, and 64-bit file images.
Call the GetFileVersionInfoSize function before calling the GetFileVersionInfo function. To retrieve information from the file-version information buffer, use the VerQueryValue function.
Function Information
Minimum DLL Versionversion.dll
HeaderDeclared in Winver.h, include Windows.h
Import libraryVersion.lib
Minimum operating systemsWindows 95, Windows NT 3.1
UnicodeImplemented as ANSI and Unicode versions.
See Also
Version Information Overview , GetFileVersionInfoSize , VerQueryValue , VS_VERSIONINFO
==原始网址==http://msdn.microsoft.com/en-us/library/ms647003(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:27:35