Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00228150
Message ID:
00228333
Views:
11
>>>Get the default browser for the machine?
>>>
>>>
>>>Wayne
>>
>>You could check in the registry to see the Shell/Open command registered for htm files. This will be a two step process as different browsers register htm files as different file types. You'l have to look in HKEY_CLASSES_ROOT/.htm. After getting the value, check further down in HKEY_CLASSES_ROOT for that type (for example, htm files on my machine or of type htmlfile.
>>
>>I then have to check HKEY_CLASSES_ROOT/htmlfile/Shell/Open/Command to see the path to the program used to view html.
>>
>>There is probably an API call to get the default application for a file type, but I don't know it. George? Ed?
>>
>
>You can use:-
>
>declare long FindExecutable in "shell32.dll" ;
>string lpFile, string lpDirectory, string @lpResult
>
>local buffer, result
>
>buffer = space(2000)
>
> result = FindExecutable("c:\test.htm", "c:\", @buffer)
> if result < 32
> messageBox("** FAILED **")
> else
> messageBox("--- success --- [" + alltrim(buffer) + "]")
> * run it...
> endif
>
>You'll probably get back "[name of program][space][name of file]" e.g.
>"c:\apps\netscape.exe c:\test.htm"
>
>Remember to allocate space to the buffer - it's a little messy otherwise :-)
I'll give both methods a shot, thanks.
Wayne
Wayne Myers, MCSD
Senior Consultant
Forte' Incorporated
"The only things you can take to heaven are those which you give away" Author Unknown
Previous
Reply
Map
View

Click here to load this message in the networking platform