Funktionreferenz


_WinAPI_ShellGetLocalizedName


Retrieves the localized name of a file in a Shell folder

#include <WinAPIShellEx.au3>
_WinAPI_ShellGetLocalizedName ( $sFilePath )

Parameter

$sFilePath The path to the target file.

Rückgabewert

Success: The array that contains the following information:
[0] - The path to the module containing string resource that specifies the localized version of the file name.
[1] - ID of the localized file name resource.
Failure: Sets the @error flag to non-zero, @extended flag may contain the HRESULT error code.

Bemerkungen

This function requires Windows Vista or later.

Siehe auch

Suche nach SHGetLocalizedName in der MSDN Bibliothek.

Beispiel

#include <MsgBoxConstants.au3>
#include <WinAPIRes.au3>
#include <WinAPIShellEx.au3>
#include <WinAPISys.au3>

If Number(_WinAPI_GetVersion()) < 6.0 Then
    MsgBox(($MB_ICONERROR + $MB_SYSTEMMODAL), 'Fehler', 'Benötigt Windows Vista oder neuer.')
    Exit
EndIf

Local $Data = _WinAPI_ShellGetLocalizedName(@MyDocumentsDir)
If Not IsArray($Data) Then
    Exit
EndIf

Local $hModule = _WinAPI_LoadLibraryEx($Data[0], $LOAD_LIBRARY_AS_DATAFILE)
ConsoleWrite('Pfad: ' & $Data[0] & @CRLF)
ConsoleWrite('ID:   ' & $Data[1] & @CRLF)
ConsoleWrite('Name: ' & _WinAPI_LoadString($hModule, $Data[1]) & @CRLF)
_WinAPI_FreeLibrary($hModule)