Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

child windows of IE from getobject

Status
Not open for further replies.

JL42

Technical User
Jun 23, 2003
12
US
I'm trying to write a pop-up blocker. I can grab the top level parent of Internet Explorer with

set oie = getobject( ,"InternetExplorer.Application")

but if other windows have been opened by shift+click or a window.open statement, I can't seem to grab a hold of it, nor can I find a windows or childwindow collection or object. Taskmanager shows only one IEXPLORE.EXE running both windows. Any ideas on how I can grab that second window?
 
Thanks to member billchris, the key is the shell.shellwindows collextion under the object "shell.application"

here is a vbscript demo

================================
dim objShell, objShellWindows, i

set objShell = createObject("Shell.Application")
set objShellWindows = objShell.Windows

if (not objShellWindows is nothing) then
for i = 0 to objShellWindows.count - 1
msgbox objShellWindows.Item(i).locationurl
next
end if

set objShellWindows = nothing
set objShell = nothing

'thanks to member billchris
========================================
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top