Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating a .lnk file
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00203429
Message ID:
00203703
Vues:
17
>Is there an API call or some C++ function that can be called to create a windows .lnk file (shortcut) from VFP. I want to be able to read a dbf file containing exe information and dynamically create a shortcut to the exe on the windows desktop.
>

In addition to the wrapper .DLL approaches referenced by Christof and George (George's wrapper .DLL here on UT is by far the better choice, with much more complete support of the IShellLink API and some useful stuff for finding the current Start Menu and Desktop, you might want to use the OLE Autyomation object Wscript.Shell, part of the Windows Scripting Host, which has a CreateShortcut method that can manipulate shortcuts. The Windows Schipting Host, part of Win98 and WinNT5/Win2K, can be added to any Win9x or WinNT system (in fact, installing IE4 or IE5 should add at least some of the components) by downloading a freelt redistributable self-installing executable from http://msdn.microsoft.com/scripting. Theres a great deal of functionality in the WSH; three primary automation objects are directly available to VFP (Wscript.Shell, Wscript.Network, and Scripting.FileSystemObject) and it also provides a mechanism to run VBScript or JScript from within your application. John Petersen did an article on the WSH for FoxTalk a few months back, and there have been excellent articles in the magazine Windows NT Systems over the past couple of months.

>Rick Napolitan
>
>nappy@twd.net.com
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform