Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Launch browser from VFP?
Message
De
09/02/2001 02:35:32
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00469536
Message ID:
00474335
Vues:
24
>> oShellEx = NEWOBJECT('_ShellExecute',HOME() + 'FFC\_environ.vcx')
>> oShellEx.ShellExecute('http://www.levelextreme.com')
>
>I tried this, and it works great, except the browser opens "behind" my VFP window. How can I force the browser to open on "top"?

You could add code to using the API call FindWindow() to get the hWnd of the browser Window, and then call SetForegroundWindow() to force it to the top (see the API section for examples of these two API calls), or you could modify the ShellExecute() method of the FFC to open the browser maximized:

Add a line immediately before the RETURN line:
DECLARE INTEGER GetActiveWindow IN Win32API
Change the line that reads:
RETURN ShellExecute(0,lcOperation,lcFilename,"",lcWorkDir,1)
to read:
RETURN ShellExecute(GetActiveWindow(),lcOperation,lcFilename,"",lcWorkDir,3)  && maximized
or you might try:
RETURN ShellExecute(GetActiveWindow(),lcOperation,lcFilename,"",lcWorkDir,5)  && alternative normal
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