Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ShellExecute should call Netscape, but isn't
Message
De
27/07/2000 20:45:55
 
 
À
27/07/2000 17:39:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00393880
Message ID:
00397955
Vues:
14
>>>I have a form in my program that allows the user to enter a URL, click a button, and have the site come up in their default Internet browser. On one computer, their default browser in Netscape Communicator 4.7 (downloaded and installed last Thursday).
>>>The button is based on the _hyperlinkcommandbutton class from the _hyperlink class library found in VFP, and it is their code that is running. The registry entry HEKY_CLASSES_ROOT\http\shell\open\ddeexec\Application is checked to see what my default browser is (in this case "nsshell"). If it is not "iexplore" (which is Internet Explorer), it calls the ShellExecute API function, passing it the URL.
>>>
>>
>>Without digging through the FFC code, have you tried just a simple ShellExecute? What does that do?
>
>I created a program with the following code:
>
>lcURL = "http://www.microsoft.com/"
>
>DECLARE INTEGER ShellExecute IN SHELL32 ;
> INTEGER, ;
> STRING, ;
> STRING, ;
> STRING, ;
> STRING, ;
> INTEGER
>
>=ShellExecute(0, ;
> 'OPEN',;
> lcUrl,;
> '',;
> '',;
> 1)
>
>

It appears to tie to the server designated by HKEY_CLASSES_ROOT\HTTP\shell\open\ddeexec\Application, so that even if the key HKEY_CLASSES_ROOT\HTTP\shell\open\command points to NetScape, if it sees the DDE application pointing to IExplore, it instances InterNetExplorer.Application to service the request. Look at the code from _hyperlinkbase from _HYPERLINK.VCX for the getdefaultbrowser method for some clues. I'd check your registry to see what's down the shell\open\ddeexec\Application rabbit hole to see where it points.

The only time it uses ShellExecute() is if there's no pointer to IExplore; it instances InternetExplorer.Application if it sees that it's available to exploit from the DDE reference.

>I ran this in several ways: running it as a.prg from the Command Window, building it into an executable and running it from Command, and running the executable outside of VFP. In all cases, it brought up Netscape NAvigator and wnet to the Microsoft site, as expected. This shows that the ShellExecute API call is not the culprit.
>
>Has anyone else run into any proiblems using the _hyperlink class, unmodified, to open a URL when Netscape is the default browser? As I stated in my original message, the class works correctly when I run my application from source code within VFP, but insists on bringing up Internet Explorer when I run it from an executable.
>
>I'm going to try uninstalling Internet Explorer and see what happens, and I'm also going to create a simple executable with a text box and a command button based on the _hyperlinkcommandbutton class. I am somewhat reluctant to tinker with a Microsoft-written class library, but I may not have much choice but to do some trial-and-error work on it.
>
>TIA,
>Bill
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform