Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem is refresh!
Message
 
 
À
30/01/2001 00:30:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00465054
Message ID:
00470807
Vues:
70
>Using Setup wizard of VFP6.0, I have created set up files. Now when I install it using this setup files, it gets an entry in Program Menu (PM Item). I want to have a shortcut on my desktop created automatically as well. Is there any way, by which I can create a shortcut on my desktop.

Hello, Hemant.

You can use a post-executable file written in VFP. The setup wizard ask if you want to run one as the last step of the setup.

There, you can try using Windows API, or even easier, WSH (but that depends on its availability).

With Windows Script Host, it's easy:
* Creates an instance of the WSH Shell
loShell = CreateObject( "WScript.Shell" )

* Gets the path for Windows Desktop
lcDesktop = loShell.SpecialFolders( "Desktop" )

* Creates a wrapper object for a link file (it doesn´t create it yet)
loLink = loShell.CreateShortcut( lcDesktop + "\Hemant.lnk" ) && Choose a name

* Sets the shortcut various properties
loLink.TargetPath = <the path to your executable here>
loLink.IconLocation = <the location of the icon you want for the shortcut>
loLink.WorkingDirectory = <the start path, usually same as the exe>
loLink.WindowStyle = 3 && 1=Normal, 2=Minimized, 3=MAximized
loLink.Arguments = <any special argument>
loLink.HotKey = <any optional hotkey>

* Finally, saves the link file, actually creating the shortcut
loLink.Save()
The best is to copy the different properties from a hand-made shortcut (hotkey in particular is a bit pesky).

Hope this helps,
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform