Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Default Browser
Message
From
10/08/2001 13:29:38
 
 
To
10/08/2001 12:20:43
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00542144
Message ID:
00542404
Views:
23
I missed the pre-history of this thread and therefore don't know if I'm reposting a tip. Anyway, there is a VFP foundation class that you can use to address this issue with minimum fuss.

From the Component Gallery / Foundation Classes / Utilities insert the "Registry Access" class library into your project and
SET CLASSLIB TO "registry" ADDITIVE
...
loApplication = CREATEOBJECT("registry.filereg")

IF TYPE("loApplication")="O" AND loApplication.GetAppPath("HTM",@lcFileDescription,@lcBrowser,.F.)=0
  IF LEFT(lcBrowser,1)='"'
    lcBrowser = LEFT(lcBrowser,AT('"',lcBrowser,2))
    lcBrowser = SUBSTR(lcBrowser,2,LEN(lcBrowser)-2)
  ENDIF
ENDIF
lcBrowser holds the path to the default executable

>I think the sample code from Cetin is my best option so far as it returns the executable file associated with a file extention. So I can pass it "HTM" and it will return the default executable to open htm files.

bye
----------------------------------
António Tavares Lopes
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform