Re: VBScript/COM DCOM settings

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I've got nothing useful on this, unfortunately. : / I do have some comments on tabbing, which don't tell us much useful either. Excuse the PowerShell in data gathering below; it made it much easier to quickly test some things...

"Csaba Gabor" <danswer@xxxxxxxxx> wrote in message news:ae245a9f-e36e-4a9f-98f0-cb3fe5525605@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

http://msdn.microsoft.com/en-us/library/aa768329(VS.85).aspx

It says that pDisp, the first argument to DocumentComplete
is either a frame or top level window (of typename
HTMLWindow2 - it doesn't say that part, but that's what it is).

Side topic from this page: What's the distinction between "top level" and "highest level"? This from the Remarks section puzzles me:

"In the loading process, the highest level frame, which is not necessarily the top-level frame, fires the final DocumentComplete event."


Comments on the tabbed browsing issue below:
In any case, this issue of IE as a tabbed browser is
interesting. I am particularly interested in the
COM/VBScript way of doing the following:

1) Given an IE object, how do you enumerate the
top level windows (ie. the tabs)?

Shell.Application works fine. There's apparently a "root" IE running, but even though it shows up on the process list, it will never return a window object when you enumerate windows using Shell.Application's Windows() method. Here's what you see if you check processes with a tabbed browser running and then switch tabs and check again; the identity of the tab seems to be swapped:

PS> gps iexplore | sort starttime | ft id,starttime,mainwindowhandle,mainwindowtitle -autosize

Id StartTime MainWindowHandle MainWindowTitle
-- --------- ---------------- ---------------
4024 2009-04-12 08:58:31 133484 DocumentComplete Event (InternetExplorer, WebBrowser) - Windows Internet Explorer
3096 2009-04-12 09:00:36 0
4560 2009-04-12 09:38:02 0


PS> gps iexplore | sort starttime | ft id,starttime,mainwindowhandle,mainwindowtitle -autosize

Id StartTime MainWindowHandle MainWindowTitle
-- --------- ---------------- ---------------
4024 2009-04-12 08:58:31 133484 Google Advanced Search - Windows Internet Explorer
3096 2009-04-12 09:00:36 0
4560 2009-04-12 09:38:02 0

2) How do I spawn a new tab in a given IE?

I have no idea whether it's possible or not, although it's almost certainly not controllable through standard COM automation, since that apparent root IE instance can't be accessed. If I have multiple IE tabs running and start a new IE instance from script, it shows up as a child of the same IE instance as the tabs - see this:

PS> $ie = new-object -comobject InternetExplorer.Application
PS> gwmi win32_process | ?{$_.name -eq "iexplore.exe"} | ft ProcessId,ParentProcessId -AutoSize

ProcessId ParentProcessId
--------- ---------------
4024 2816
3096 4024
4560 4024
4816 4024

However, if I make the window visible, it doesn't show up in the current tab set. This is probably tied in to security decisions.

3) How do I activate (bring to top) a given tab?
For example, imagine I had titles C, C#, D, D#, E, F...
and I wanted to play a little tune and activate the
corresponding tab in time to the music. Could I
do that?

The best tool for this job is always Sendkeys.

PS. In case it wasn't clear, the example under
question 3 was a joke.

In case it wasn't clear, so was the answer. :p
Unfortunately, I don't have a serious answer. It probably IS possible to do somehow via APIs or even .NET use, and it's quite possible that such a path will never be blocked since it doesn't have the same risks as direct COM exposure in this context - but even if that weren't a vague answer, it wouldn't help much with either WSH or PHP invocation.

.



Relevant Pages

  • Re: Task Bar Organization
    ... Microsoft Certified Professional ... Microsoft MVP [Windows] ... Internet Explorer - Internet Explorer - Windows Media Player - Microsoft ... Or whichever way I feel like organizing my tabs on the task bar. ...
    (microsoft.public.windows.file_system)
  • Re: [Usability] Re: two-panel nautilus view
    ... I've been thinking about the two panel interface since the question came ... suffered from the same problem until they started using tabs. ... So there's been even less reason to have tiled browser windows ... The KDE file manager and web browser - Konqueror - has long allowed you to ...
    (GNOME)
  • Re: Turbine Posts Full LotRO Game Manual
    ... I use rclick-swipe left or right to go backward or forwards, ... wheel all those years ago. ... You can create mgests to close tabs, open all links in new tabs, etc, ... because navigation between windows works without a mouse at all. ...
    (comp.sys.ibm.pc.games.rpg)
  • Re: Maybe Safari 4 actually is for Windows
    ... Aero Glass, Windows' controls, ClearType text rendering- the ... Here is another detail I notice: Safari 4 on Windows has no menu bar. ... I do find the tabs to be odd. ...
    (comp.sys.mac.advocacy)
  • Re: Reinstalling updates over and over/Display Properties Messed Up
    ... 2004 Windows MVP "Winny" Award ... "Jim Carlock" wrote in message ... > Taskbar Repair Tool Plus! ... Would you know which registry keys are used to present all the tabs? ...
    (microsoft.public.windowsxp.general)