(SST) ShlWAPIFunctionInfo Version 1.0

Developer Reference
TSSTDllVerInfo.WinApiGetResourceLanguageId Method
Retrieves the primary language and codepage identirfier pair from the specified memory mapped version information resources.
Scope
Protected (i.e. the method can only be accessed from code in a descendant class or the unit it which it is implemented).
Syntax
Function WinApiGetResourceLanguageId(aresverinfop : POINTER) : TSSTWinResLanguageId;  
Parameters
aresverinfop [in] A pointer to the in-memory copy of the version information resources from which to return the first element of the array of language and code page identifiers.
Return Values
Returns the primary, numerical, language and code-page ids in form of a TSSTWinResLanguageId record/structure. This can be a record in which both members are zero (= 0).
Remarks
The function always returns the first (i.e. the primary) language and codepage identifier pair/combination, even if the translation array contains several elements.
In some older documents, the codepage identifier is also referred to as the "character set" or "charset" id.
The function verifies that the pointer passed to the function in parameter aresverinfop is not nil. If it isn't, this pointer is specified as the first parameter in a call to the ANSI version of the Windows API function VerQueryValue for sub-block "\VarFileInfo\Translation". If the API function-call succeeds (i.e. VerQueryValue returns TRUE), and both the values returned via the third and fourth parameters are valid (i.e. non-zero), WinApiGetResourceLanguageId casts the pointer returned in the lplpBuffer parameter to a PSSTWinResLanguageId and copies the dereferenced data into the record returned to the caller of the method. If VerQueryValue returns FALSE or either of the values returned in the parameters are invalid (i.e. nil/zero), WinApiGetResourceLanguageId calls procedure SetLastErrorCode with a default error code of -1 (0xFFFFFFFF) and returns a record in which both members/fields are 0. An empty record is also returned if the parameter passed to the method on call is nil.
It is not uncommon that the language and codepage combination for which resources are defined is LANG_NEUTRAL (= 0x00), SUBLANG_NEUTRAL (= 0x00). As this also applies to version information resources and these values are returned in the TSSTWinResLanguageId record, it is not advisable to infer from such a record, that the method was unable to retrieve the desired data. To determine if the method failed, read property LastError immediately after the call.
Requirements
Unit (Declared and implemented in) SSTNewUnit.pas
Library SSTNewUnit.dcu/SSTNewUnit.obj
Unicode Implemented as ANSI version only.
See Also
TSSTDllVerInfo, TSSTWinResLanguageId, ResourceLanguageId, RetResourceLanguageId, ResourceLanguageIdAsStr, RetResourceLanguageIdAsStr, LastError, SetLastErrorCode, Source Code.
 
Windows APIs: VERSIONINFO Resource, VerQueryValue, Var Structure, GetLastError.


Document/Contents version 1.00
Page/URI last updated on April 28, 2022
 
Copyright © Stoelzel Software Technologie (SST) 2010 - 2017
Suggestions and comments mail to:
webmaster@stoelzelsoftwaretech.com