Function Reference


_WinAPI_VerQueryValueEx

Retrieves the text information from the version-information resource of the specified binary module

#include <WinAPIRes.au3>
_WinAPI_VerQueryValueEx ( $hModule [, $sValues = '' [, $iLanguage = 0x0400]] )

Parameters

$hModule The handle to a module to retrieve information. Also, this parameter can specify the name of the
module to load, it must be a full or relative path. If this parameter is 0 or an empty string, that is
equivalent to passing in a handle to the module used to create the current process.
$sValues [optional] The string containing the field names for which you want to get values. The names must be separated by a "|".
For example, "name1|name2|...|namei". If some fields do not exist, the corresponding array elements is an empty string.
If this parameter is not specified (empty string), uses the reserved names (12) in the following sequence:
    $FV_COMMENTS ("Comments")
    $FV_COMPANYNAME ("CompanyName")
    $FV_FILEDESCRIPTION ("FileDescription")
    $FV_FILEVERSION ("FileVersion")
    $FV_INTERNALNAME ("InternalName")
    $FV_LEGALCOPYRIGHT ("LegalCopyright")
    $FV_LEGALTRADEMARKS ("LegalTrademarks")
    $FV_ORIGINALFILENAME ("OriginalFilename")
    $FV_PRODUCTNAME ("ProductName")
    $FV_PRODUCTVERSION ("ProductVersion")
    $FV_PRIVATEBUILD ("PrivateBuild")
    $FV_SPECIALBUILD ("SpecialBuild")

Constants are defined in FileConstants.au3.
$iLanguage [optional] The language identifier of the version-information resource of interest. To retrieve information for
user default language set this parameter to $LOCALE_USER_DEFAULT (Default). To retrieve information for all
languages that are located in the resource set this parameter to (-1).

Return Value

Success: The 2D array of the string values that specified by $sValues parameter for each language. The zeroth
array element [0][0] contains the number of languages of the resource. The array dimension (i) equal
to the number specified parameters + 1. The zeroth array element [n][0] contains the language
identifier (ID).
[0][0] - Number of languages (n)
[0][i] - Unused
[n][0] - ID
[n][i] - Value
Failure: Sets the @error flag to non-zero.

Remarks

The identifier (ID) of the version-information resource should be equal to 1, otherwise the function fails.

Example

#include <APILocaleConstants.au3>
#include <Array.au3>
#include <WinAPILocale.au3>
#include <WinAPIRes.au3>

Local $aData = _WinAPI_VerQueryValueEx(@ScriptDir & '\Extras\Resources.dll', 'FileDescription|FileVersion|OriginalFilename', -1)

If Not @error Then
        For $i = 1 To $aData[0][0]
                $aData[$i][0] = _WinAPI_GetLocaleInfo($aData[$i][0], $LOCALE_SLANGUAGE)
        Next
EndIf

_ArrayDisplay($aData, '_WinAPI_VerQueryValueEx')