On Apr 13, 5:56 pm, mully <david.mul... / gmail.com> wrote:
> On Apr 13, 8:20 am, David Mullet <david.mul... / gmail.com> wrote:
>
>
>
> > William James wrote:
> > > This seems not to work.
>
> > > require 'win32ole'
> > > ie = nil
> > > WIN32OLE.new('Shell.Application').Windows.each do |window|
> > >   p window.FullName
> > >   p window.Name
> > >   begin
> > >     title = window.Document.Title
> > >     p title
> > >     if title =~ /Internet Explorer/
> > >       ie = window
> > >     end
> > >   rescue
> > >   end
> > > end
> > > p ie
>
> > > --- output ---
> > > "C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE"
> > > "Microsoft Internet Explorer"
> > > ""
> > > nil
>
> > A key distinction here is between window.Name and window.Document.Title
>
> [Re-posting my reply, as it seems to have been truncated on Google
> Groups...]
>
> A key distinction here is between window.Name and
> window.Document.Title.
>
> window.Document.Title is the Title as defined in the HTML code of a
> window with a Type of "HTML Document". This probably equates to the
> window.LocationName property. The titlebar text will include both
> window.Document.Title and window.Name, so...

The problem was that I had no html document loaded; the titlebar
text was "about:blank - Microsoft Internet Explorer" but
window.Document.Title was simply "".