网站首页  词典首页

请输入您要查询的函数:

 

术语 verqueryvalue
释义 VerQueryValue
语法:
BOOL VerQueryValue( LPCVOID pBlock,
LPCTSTR lpSubBlock,
LPVOID *lplpBuffer,
PUINT puLen
);
VerQueryValue函数
该VerQueryValue函数检索指定从指定的版本信息资源的版本信息。要检索适当的资源,调用VerQueryValue之前,必须先调用GetFileVersionInfoSize功能,然后GetFileVersionInfo函数。
参数
pBlock
[in]指向缓冲区包含版本信息资源的GetFileVersionInfo函数返回。
lpSubBlock
[in]指向零结尾的字符串指定的版本信息的价值来检索。该字符串必须包括由反斜杠分隔的名称(\\),它必须具有下列形式之一。
\\
指定根块。该函数检索的指针的版本信息资源VS_FIXEDFILEINFO结构。
\\ VarFileInfo \\翻译
指定的var变量的信息结构转换数组这种结构的价值的成员。函数指针检索这种语言和代码页标识符数组。应用程序可以使用这些标识符来访问一个特定语言的字符串表结构(使用安装路径成员)的版本信息资源。
\\ StringFileInfo \\朗代码页\\字符串名称
指定的语言值特定的字符串表结构。在朗代码页的名字是一个语言和代码页标识符对串联作为一个DWORD发现为资源转换数组。在这里,朗代码页名称必须被指定为一个十六进制字符串。该字符串的名称,必须在以下备注一节中描述的预定义字符串之一。该函数检索一个字符串值特定语言和代码页显示。
lplpBuffer
[内]当此方法返回时,包含一个指针的地址的缓冲区中要求的版本信息指向pBlock。该内存指向lplpBuffer被释放时,相关的pBlock释放内存。
puLen
[内]当此方法返回,包含一个指针所要求的数据大小指向lplpBuffer:版本信息的价值,在字符串的长度TCHARs在lplpBuffer储存;翻译数组值,在字节大小数组存储在lplpBuffer;以及根块,在结构的字节大小。
返回值
如果指定的版本的信息结构是存在的,版本信息是可用的,返回非零值。如果缓冲区的地址长度是零,没有值指定版本信息名称可用。
如果指定的名称不存在或指定的资源是无效的,则返回值是零。
备注
Windows NT 3.51和更早的版本:版本信息功能不使用16位Windows文件图像。
Windows 95/98/Me中,Windows NT 4.0和Windows 2000中:这些问题都16 -和32位文件的图像功能的工作。
Windows XP中:这些功能工程16 - ,32 - ,和64位文件的图像。
以下是预定义的版本信息Unicode字符串。
CommentsInternalNameProductName
CompanyNameLegalCopyrightProductVersion
FileDescriptionLegalTrademarksPrivateBuild
FileVersionOriginalFilenameSpecialBuild
例如
下面的示例演示如何枚举可用的版本,语言和检索FileDescription字符串为每种语言的价值。
一定要调用之前调用VerQueryValue正确初始化pBlock缓冲区GetFileVersionInfoSize和GetFileVersionInfo功能。
在Windows 95/98/Me:VerQueryValueW是支持微软层对于Unicode。调用这个函数的第二次\\ StringFileInfo \\信息将覆盖从第一个呼叫信息,所以您必须保存信息,如果您想使用它。若要使用此版本,您必须添加一些文件到您的应用,概述了对Unicode的Microsoft层在Windows 95/98/Me系统。
// Structure used to store enumerated languages and code pages.
HRESULT hr;
struct LANGANDCODEPAGE {
WORD wLanguage;
WORD wCodePage;
} *lpTranslate;
// Read the list of languages and code pages.
VerQueryValue(pBlock,
TEXT("\\\\VarFileInfo\\\\Translation"),
(LPVOID*)&lpTranslate,
&cbTranslate);
// Read the file description for each language and code page.
for( i=0; i < (cbTranslate/sizeof(struct LANGANDCODEPAGE)); i++ )
{
hr = StringCchPrintf(SubBlock, 50,
TEXT("\\\\StringFileInfo\\\\%04x%04x\\\\FileDescription"),
lpTranslate[i].wLanguage,
lpTranslate[i].wCodePage);
 if (FAILED(hr))
 {
 // TODO: write error handler.
 }
// Retrieve file description for language and code page "i".
VerQueryValue(pBlock,
SubBlock,
&lpBuffer,
&dwBytes);
}
功能信息
最低DLL版本 version.dll
在Winver.h HeaderDeclared,头文件:winuser.h
import libraryVersion.lib
最低操作系统Windows 95,Windows NT 3.1
UnicodeImplemented为ANSI和Unicode版本。
参见
版本信息概览,GetFileVersionInfo,VarFileInfo,无功,StringFileInfo,字符串表,字符串,GetFileVersionInfoSize,VS_FIXEDFILEINFO,VS_VERSIONINFO
==英文原文==VerQueryValue Function
The VerQueryValue function retrieves specified version information from the specified version-information resource. To retrieve the appropriate resource, before you call VerQueryValue, you must first call the GetFileVersionInfoSize function, and then the GetFileVersionInfo function.
Syntax
BOOL VerQueryValue( LPCVOID pBlock,
LPCTSTR lpSubBlock,
LPVOID *lplpBuffer,
PUINT puLen
);
Parameters
pBlock
[in] Pointer to the buffer containing the version-information resource returned by the GetFileVersionInfo function.
lpSubBlock
[in] Pointer to a zero-terminated string specifying which version-information value to retrieve. The string must consist of names separated by backslashes (\\) and it must have one of the following forms.
\\
Specifies the root block. The function retrieves a pointer to the VS_FIXEDFILEINFO structure for the version-information resource.
\\VarFileInfo\\Translation
Specifies the translation array in a Var variable information structure—the Value member of this structure. The function retrieves a pointer to this array of language and code page identifiers. An application can use these identifiers to access a language-specific StringTable structure (using the szKey member) in the version-information resource.
\\StringFileInfo\\lang-codepage\\string-name
Specifies a value in a language-specific StringTable structure. The lang-codepage name is a concatenation of a language and code page identifier pair found as a DWORD in the translation array for the resource. Here the lang-codepage name must be specified as a hexadecimal string. The string-name name must be one of the predefined strings described in the following Remarks section. The function retrieves a string value specific to the language and code page indicated.
lplpBuffer
[out] When this method returns, contains the address of a pointer to the requested version information in the buffer pointed to by pBlock. The memory pointed to by lplpBuffer is freed when the associated pBlock memory is freed.
puLen
[out] When this method returns, contains a pointer to the size of the requested data pointed to by lplpBuffer: for version information values, the length in TCHARs of the string stored at lplpBuffer; for translation array values, the size in bytes of the array stored at lplpBuffer; and for root block, the size in bytes of the structure.
Return Value
If the specified version-information structure exists, and version information is available, the return value is nonzero. If the address of the length buffer is zero, no value is available for the specified version-information name.
If the specified name does not exist or the specified resource is not valid, the return value is zero.
Remarks
Windows NT 3.51 and earlier: The version information functions do not work with 16-bit Windows file images.
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 works on 16-, 32-, and 64-bit file images.
The following are predefined version information Unicode strings.
CommentsInternalNameProductName
CompanyNameLegalCopyrightProductVersion
FileDescriptionLegalTrademarksPrivateBuild
FileVersionOriginalFilenameSpecialBuild
Example
The following example shows how to enumerate the available version languages and retrieve the FileDescription string-value for each language.
Be sure to call the GetFileVersionInfoSize and GetFileVersionInfo functions before calling VerQueryValue to properly initialize the pBlock buffer.
Windows 95/98/Me: VerQueryValueW is supported by the Microsoft Layer for Unicode. Calling this function a second time for \\StringFileInfo\\ information will overwrite the information from the first call, so you must save the information if you want to use it later. 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 .
// Structure used to store enumerated languages and code pages.
HRESULT hr;
struct LANGANDCODEPAGE {
WORD wLanguage;
WORD wCodePage;
} *lpTranslate;
// Read the list of languages and code pages.
VerQueryValue(pBlock,
TEXT("\\\\VarFileInfo\\\\Translation"),
(LPVOID*)&lpTranslate,
&cbTranslate);
// Read the file description for each language and code page.
for( i=0; i < (cbTranslate/sizeof(struct LANGANDCODEPAGE)); i++ )
{
hr = StringCchPrintf(SubBlock, 50,
TEXT("\\\\StringFileInfo\\\\%04x%04x\\\\FileDescription"),
lpTranslate[i].wLanguage,
lpTranslate[i].wCodePage);
 if (FAILED(hr))
 {
 // TODO: write error handler.
 }
// Retrieve file description for language and code page "i".
VerQueryValue(pBlock,
SubBlock,
&lpBuffer,
&dwBytes);
}
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 , GetFileVersionInfo , VarFileInfo , Var , StringFileInfo , StringTable , String , GetFileVersionInfoSize , VS_FIXEDFILEINFO , VS_VERSIONINFO
==原始网址==http://msdn.microsoft.com/en-us/library/ms647464(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:31:23