Funktionreferenz


_WinAPI_LoadStringEx


Loads a string resource for the specified language from the specified module

#include <WinAPIRes.au3>
_WinAPI_LoadStringEx ( $hModule, $iID [, $iLanguage = $LOCALE_USER_DEFAULT] )

Parameter

$hModule A handle to an instance of the module whose executable file contains the string resource.
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.
$iID The identifier of the string to be loaded.
$iLanguage [optional] The language identifier of the string resource of interest. To retrieve string for user default
language set this parameter to $LOCALE_USER_DEFAULT (Default).

Rückgabewert

Success: The string.
Failure: Empty string and sets the @error flag to non-zero.

Bemerkungen

None.

Beispiel

#include <APILocaleConstants.au3>
#include <APIResConstants.au3>
#include <MsgBoxConstants.au3>
#include <WinAPILocale.au3>
#include <WinAPIRes.au3>

Local $hInstance = _WinAPI_LoadLibraryEx(@ScriptDir & '\Extras\Resources.dll', $LOAD_LIBRARY_AS_DATAFILE)
If Not $hInstance Then
    MsgBox(($MB_ICONERROR + $MB_SYSTEMMODAL), 'Fehler', @ScriptDir & '\Extras\Resources.dll nicht gefunden.')
    Exit
EndIf

; Warum ist der Ressourcenname für den String mit ID = 6000 376? 6000 / 16 + 1 = 376
Local $aData = _WinAPI_EnumResourceLanguages($hInstance, $RT_STRING, 376)
If IsArray($aData) Then
    For $i = 1 To $aData[0]
        ConsoleWrite(StringFormat('%-10s - %s', _WinAPI_GetLocaleInfo($aData[$i], $LOCALE_SENGLANGUAGE), _WinAPI_LoadStringEx($hInstance, 6000, $aData[$i])) & @CRLF)
    Next
EndIf