Taking over prior IE window from script 
Author Message
 Taking over prior IE window from script

OK...I don't understand how I can do this-

I can get a reference to a prior instance of Internet Explorer using
Shell.Application, then take it over.  The following works; if I have an open IE
window, I can grab it with this script piece and send it where I want.

Doesn't this violate something fundamental?

set oSA=CreateObject("Shell.Application")
set cWin = oSA.Windows
for each Win in oSA.Windows
set oIE = Win.Application
next
oIE.Navigate " http://www.*-*-*.com/ "



Wed, 06 Oct 2004 01:46:09 GMT  
 Taking over prior IE window from script

Quote:

> OK...I don't understand how I can do this-

> I can get a reference to a prior instance of Internet Explorer using
> Shell.Application, then take it over.  The following works; if I have an open
> IE window, I can grab it with this script piece and send it where I want.

> Doesn't this violate something fundamental?

No, since you as the user have initiated the action by executing a script to use the Shell.Application object in a trusted environment.  It's just an automated way of typing a new url in address box of an open IE instance and pressing enter.

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US
--



Wed, 06 Oct 2004 02:57:37 GMT  
 Taking over prior IE window from script
As I posted, it occurred to me that this did look like browser re-use...

Is there any way to manipulate this to access other applications currently
running?



Quote:

> OK...I don't understand how I can do this-

> I can get a reference to a prior instance of Internet Explorer using
> Shell.Application, then take it over.  The following works; if I have an open
> IE window, I can grab it with this script piece and send it where I want.

> Doesn't this violate something fundamental?

No, since you as the user have initiated the action by executing a script to use
the Shell.Application object in a trusted environment.  It's just an automated
way of typing a new url in address box of an open IE instance and pressing
enter.

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US
--



Wed, 06 Oct 2004 04:36:35 GMT  
 Taking over prior IE window from script

Quote:

> As I posted, it occurred to me that this did look like browser re-use...

> Is there any way to manipulate this to access other applications currently
> running?

No...  

The Shell App's Windows collection exposes only WebBrowser based windows "owned by the shell" (which include IE browser windows and Windows Explorer windows).  If an app hosts a WebBrowser control or mshtml.dll directly (like mshta.exe does), they are *not* visible in the Windows collection, nor are conventional application windows.

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US
--



Wed, 06 Oct 2004 05:02:45 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Error 80010108 starting IE from VBScript with prior IE instances open

2. Resize window prior to loading page...

3. Taking over an IE with WSH

4. Printer removal prior to logging off with script file

5. Printer removal prior to logging off with script file

6. Firing events on a parent IE window from a child IE window

7. window.open() takes too long in IE5

8. Script Control "Taking a long time"

9. InterDev takes over the Script Control Errors

10. Web page contains script that takes an unusually long time to run

11. Problems Installing Windows Script 5.0 and Windows Script Host 2.0 Beta on Windows NT 4.0

12. calling scripts in other IE windows (and thread synchronization)

 

 
Powered by phpBB® Forum Software