Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Automatic VFP form on http connection
Message
De
07/12/1999 09:07:32
 
 
À
07/12/1999 07:39:46
Allen Hanna
H. A. Hanna Associates
Indianola, Indiana, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00299303
Message ID:
00299703
Vues:
28
>>>>I have a client that wants a tool bar (or VFP form) to appear whenever an http connection is made through the internet. The tool bar or form would have selections for http links to various web pages. I know how to activate links from VFP through shellexec, but don't know how to launch the FVP app automatically. I would suppose the only way to do it is to have the VFP program running in the background, initiated at startup, and watching for some Windows system variable or the appearance of a particular window like MSIE or Netscape. Maybe there's a way to connect one Windows program to another so that when one launches the other follows...
>>>>
>>>
>>>The only way I know of to do this would be to launch an app in the background that runs a timer and polls for the presence of an IE instance. As Ed Rauh pointed out recently, you can use the Shell.Application object to do this:
>>>
>>>oShell = CREATEOBJECT('Shell.Application')
>>>oIECollection = oShell.Windows()
>>>FOR EACH oIE IN oShell
>>> * Do something here
>>>ENDFOR
>>>
>>>The Windows method returns a zero based collection of all open instances of Explorer (including instances of IE). You can check the LocationURL property to check for the presence of a URL that begins with "http://", and activate your app if there is one. Additional note- your application can use the handle acquired by the above code to manipulate the browser through its automation model.
>>
>>Woops, I fudged my FOR loop code- that line should read:
>>
>>FOR EACH oIE IN oIECollection
>
>Erik,
>
>This looks like something I need to know more about. What is "Shell.Application" and how can I find out more about it? Apparently you're treating the browser as an object...so then it would have properties like a VFP object, right? I would like to be able to tell what url the browser is looking at from my VFP app running in the background. Sounds like this might be possible.
>
>When I tried your code I got an error: OLE error code...class not registered. Sounds like I'm missing something.
>
>Allen

The SHellobject is a COM interface to a lot of Windows interface elements. You need a relatively new version of SHell32.dll that ships with IE4, NT SP3 (I think), and all later versions of windows (including 98). Do a search here on shell32 for a thread on this a couple of weeks ago.
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform