Login | |
|
 |
RE: Browser Helper Object support Vbscript - 11/12/2008 12:23:43 PM
|
|
 |
|
| |
TNO
Posts: 1402
Score: 16
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
|
So quick and simple, what does this provide that cannot already be done by VBS? Do you have a working example besides navigating to google?
_____________________________
To iterate is human, to recurse divine. -- L. Peter Deutsch
|
|
| |
|
|
|
 |
RE: Browser Helper Object support Vbscript - 11/13/2008 2:14:13 AM
|
|
 |
|
| |
TNO
Posts: 1402
Score: 16
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
|
Do this: Dim IE : Set IE = CreateObject("InternetExplorer.Application","event_") Then you will be able to capture events and use VBScript event subs for any of the IE object's events: http://msdn.microsoft.com/en-us/library/aa752084.aspx But documentComplete is unreliable in a few cases (firing multiple times since the browser can progressivley load). Its safer to do this: Do Until IE.readyState = 4: wscript.sleep 100: Loop
_____________________________
To iterate is human, to recurse divine. -- L. Peter Deutsch
|
|
| |
|
|
|
 |
RE: Browser Helper Object support Vbscript - 11/13/2008 4:20:04 AM
|
|
 |
|
| |
TNO
Posts: 1402
Score: 16
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
|
quote:
You're right TNO. But, this is only true if you create the instance of Internet Explorer Actually, thats what the ConnectObject method does. Anything that exposes a COM interface can be queried for its events. Like for instance the Office applications. Obviously there is a variety of ways to get a running instance of an application (like through WMI to check running processes and such)
_____________________________
To iterate is human, to recurse divine. -- L. Peter Deutsch
|
|
| |
|
|
|
 |
RE: Browser Helper Object support Vbscript - 11/13/2008 4:21:47 AM
|
|
 |
|
| |
TNO
Posts: 1402
Score: 16
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
|
An example of another way to get an instance of an IE method you didn't start: http://www.visualbasicscript.com/m_41907/mpage_1/key_popup/tm.htm#41907
_____________________________
To iterate is human, to recurse divine. -- L. Peter Deutsch
|
|
| |
|
|
|
 |
RE: Browser Helper Object support Vbscript - 11/13/2008 12:42:36 PM
|
|
 |
|
| |
TNO
Posts: 1402
Score: 16
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
|
Here's an example of how the method works: http://www.nilpo.com/2008/07/windows-scripting/controlling-when-vbscript-events-are-handled/ and here's an explanation of where it wouldnt: http://blogs.msdn.com/ericlippert/archive/2005/02/15/373330.aspx So its possible to attach an event externally (or internally in the case of a browser). The concern with missing an event is pretty unlikely and a rare thing for most to do outside of the document itself anyway. (How many cases can you think of where someone would need to attach a listener without creating an instance anyway?) The thing that is a concern is the fact that this requires installation and registration on one or more computers which makes it not very worthwhile compared to the native alternatives.
_____________________________
To iterate is human, to recurse divine. -- L. Peter Deutsch
|
|
| |
|
|
|
| |
|
|
 |
|
 |
|
|