Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GetReg Help Needed - Where is AcroRd.exe
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00168932
Message ID:
00168952
Vues:
20
>I want to call acrobat's reader from within VFP6.0
>
>!/n1 c:\acrobat3\reader\acroRd32.exe myDir\myfile.pdf works fine. Thats if I know where AcroRd32.exe is located at. I want to read the registry to determine exactly where it is loaded, if it is loaded.
>
>I've had no success with the registry.prg or class found in the VFP directories.
>
>Can anyone help?
>
Hi Robert,

There are a couple of solutions you might consider, both involving calls to the SHELL32.DLL. The first would be to use FindExecutable to locate the file, then use the RUN command. That's in line with what you're trying to do. However, another (and in my opinion, better) solution would be to use ShellExecute to run the program. Anyway, here are both:
DECLARE INTEGER FindExecutable IN Shell32;
  STRING @lpFile, STRING @lpDirectory, STRING @lpResult
DECLARE INTEGER ShellExecute IN Shell32;
  INTEGER hwnd, STRING @lpOperation, STRING @lpFile,;
  STRING @lpParameters, STRING @lpDirectory, SHORT nshow
* lcfile is the file to be found or execute
* lcpath is the working directory or path
lcbuffer = SPACE(261)
lnresult = FindExecutable(@lcfile, @lcpath, @lcbuffer)
lcop = 'open'
lcparms = ""
lnresult = ShellExecute(0, @lcop, @lcfile, @lcparms, @lcpath, 1)
In either case of value less than or equal to 32 is an error. If the file isn't associated with an application, 31 is returned.

hth,
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