Supprime le nom localisé d'un fichier dans un dossier Shell
#include <WinAPIShellEx.au3>
_WinAPI_ShellRemoveLocalizedName ( $sFilePath )
$sFilePath | Le chemin d'accès au fichier cible. |
Succès: | Retourne 1. |
Échec: | Retourne 0 et définit @error <> 0, @extended peut contenir le code d'erreur HRESULT. |
Cette fonction nécessite Windows Vista ou une version ultérieure.
Consultez SHRemoveLocalizedName dans la librairie MSDN.
#include <MsgBoxConstants.au3> #include <WinAPIShellEx.au3> #include <WinAPIShPath.au3> #include <WinAPISys.au3> If Number(_WinAPI_GetVersion()) < 6.0 Then MsgBox(BitOR($MB_ICONERROR, $MB_SYSTEMMODAL), 'Erreur', 'Nécessite Windows Vista ou une version ultérieure.') Exit EndIf Local Const $sDll = @ScriptDir & '\Extras\Resources.dll' Local Const $sDir = @TempDir & '\Temporary Folder' If Not FileExists($sDll) Then MsgBox(BitOR($MB_ICONERROR, $MB_SYSTEMMODAL), 'Erreur', $sDll & ' non trouvé.') Exit EndIf If Not DirCreate($sDir) Then MsgBox(BitOR($MB_ICONERROR, $MB_SYSTEMMODAL), 'Erreur', 'Impossible de créer le dossier.') Exit EndIf _WinAPI_ShellOpenFolderAndSelectItems($sDir) MsgBox(BitOR($MB_ICONINFORMATION, $MB_SYSTEMMODAL), '', 'Pressez OK pour définir le nom localisé de "'& _WinAPI_PathStripPath($sDir) & '".') _WinAPI_ShellSetLocalizedName($sDir, $sDll, 6000) MsgBox(BitOR($MB_ICONINFORMATION, $MB_SYSTEMMODAL), '', 'Pressez OK pour supprimer le nom localisé.') _WinAPI_ShellRemoveLocalizedName($sDir) MsgBox(BitOR($MB_ICONINFORMATION, $MB_SYSTEMMODAL), '', 'Pressez OK pour terminer le script.') DirRemove($sDir, 1)