Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find and launch an external program
Message
 
À
07/09/2000 10:56:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00413523
Message ID:
00413546
Vues:
15
>Is there an API call or a function to search a local drive for an executable, and then launch the program from Foxpro.

Depends on what you're looking for and how. First of all FindFirstFile requires that a fully qualified file name be passed. If it's not, only the current working directory is searched. It does, however, support wildcards.

If you have an existing file name associated with the file ShellExecute() will launch the associated application and open or print the file. There's documentation on ShellExecute() in the API section here, there's a class in the FFV that'll do this, and there's a program I wrote (File Runner) that's in the download section under Win32 and Other APIs. Further, the WScript.Shell object's Run method can do this as well.

If you're just looking to run another application, you'll have to "roll your own" routine to search for it, unless that application exposes a OLE Automation COM interface.
George

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

Click here to load this message in the networking platform