Function Reference


_WinAPI_ShellGetLocalizedName

Retrieves the localized name of a file in a Shell folder

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

Parameters

$sFilePath The path to the target file.

Return Value

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.

Remarks

This function requires Windows Vista or later.

See Also

Search SHGetLocalizedName in MSDN Library.

Example

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

If Number(_WinAPI_GetVersion()) < 6.0 Then
        MsgBox(($MB_ICONERROR + $MB_SYSTEMMODAL), 'Error', 'Require Windows Vista or later.')
        Exit
EndIf

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

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