// Collection de procédures globales pour le traitement des raccourcis _LINK est une structure TargetPath est une chaîne WindowStyle est un entier système // 1 Fenêtre normale ; 3 Fenêtre maximisée ; 7 Fenêtre minimisée IconLocation est une chaîne IconIndex est un entier Hotkey est une chaîne WorkingDirectory est une chaîne Description est une chaîne FIN // Récupération des infos d'un raccourci (.lnk ou .url) // sFileLnk [in] : Chemin complet du raccourci // Renvoi une structure _LINK contenant les infos associées au raccourci PROCEDURE GetShortcut(sFileLnk) // Utilisation d'un script shell Windows pour récupérer les paramètres d'un raccourci (.lnk ou .url) // Voir http://msdn.microsoft.com/en-us/library/aew9yb99(VS.85).aspx // stLINK est un _LINK WshShell est un objet Automation "WScript.Shell" oShellLink est un objet Automation dynamique QUAND EXCEPTION DANS oShellLink=WshShell>>CreateShortcut(sFileLnk) stLINK.TargetPath=oShellLink>>TargetPath stLINK.WindowStyle=oShellLink>>WindowStyle stLINK.IconLocation=ExtraitChaîne(oShellLink>>IconLocation,1,",") stLINK.IconIndex=ExtraitChaîne(oShellLink>>IconLocation,2,",") stLINK.Hotkey=oShellLink>>Hotkey stLINK.WorkingDirectory=oShellLink>>WorkingDirectory stLINK.Description=oShellLink>>Description FAIRE SI stLINK.TargetPath~="" ALORS // Ignore l'erreur si le chemin cible a été trouvé Erreur("Impossible d'extraire les infos du raccourci"+ExceptionInfo(errComplet)) FIN FIN RENVOYER stLINK