Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WSH - shortcuts, setting properties programatically
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00742107
Message ID:
00742118
Vues:
48
>The code below will create a shortcut:
>
>WshShell = Createobject("Wscript.shell")
>strDesktop = Alltrim(WshShell.SpecialFolders(tcShortCutPlacement))
>oMyShortcut = WshShell.CreateShortcut(strDesktop+"\"+tcShortCutName)
>oMyShortcut.WindowStyle = 4  && 1=normal 3=Maximized 7=Minimized  4=Normal
>oMyShortcut.IconLocation = lcSaveIconDir
>oMyShortcut.TargetPath = lcSaveTargetPath
>oMyShortcut.WorkingDirectory = lcSaveWorkingDir
>oMyShortcut.HotKey = "ALT+CTRL+F"
>oMyShortcut.Description = lcSaveDescription
>*oMyShortcut.Arguments = "C:\myFile.txt"
>
>I know the name of the shortcut determines the title you see under the icon on the screen and you can rename the 'lnk' file to change that title.
>
>1. Is there a way to name the file while creating the shortcut (different from the target name)?

The file name can be anything you like. It doesn't have to be the same as the executable.

>2. How to change other properties like 'close on exit' while creating the shortcut or programatically?

No, only the properties that Intellisense displays that are read-write are available. For example, "Close on Exit", applies only to DOS applications, and is not exposed even after the shortcut has been created and you get a reference to it with an additional CreateShortCut() command.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform