Hi Al,
Had not used the ShellExecute function before - only one spot in this client's app that launches anything and it has not changed in a dozen years. When reviewing the code in prep for extending it, I thought there had to be a better way (the old code was only for launching pdfs - it had to check for Adobe, work up the path to the Acrobat.exe program and then launch the pdf with that path).
Thanks for the pointer - should make some things a lot simpler going forward.
Albert
(p.s. Thanks also Tore)
>>Hi all,
>>
>>Is there a Windows function that would return the app needed for a file of a certain file extension? e.g. pass into it ".pdf" and it returns the full path the the Acrobat reader which I can then fire up with:
>>
>>RUN /N &lcAcrobatPath &lcDocFileName
>>
>>(where lcDocFileName contains the full path to a file name)
>>
>>I currently have a function that gets the information for Acrobat from a registry entry - but it only does .pdf files What I would prefer is something where I pass it an extension and Windows comes back with the name of the program that is supposed to open this file and/or the full file path. I then would use it to fire up the document they are pointing to.
>
>If ultimately you want to open a file using its Windows default handler, you might want to use ShellExecute rather than the VFP RUN command:
http://www.news2news.com/vfp/?function=138>
>As I understand it, in your case you would just need to input the name of the file you want to open. The default "verb" is "open", and ShellExecute does the work of finding the default handler for the file and invoking it to open your file e.g. Message#
1623280 .
>
>If you still want to do it yourself with RUN, there is more information at
http://superuser.com/questions/266268/where-in-the-registry-does-windows-store-with-which-program-to-open-certain-fil .