Brian Merchant wrote:
> Using Inspect.exe, which comes with Windows SDK, I know that Firefox has
> a toolbar with name "Navigation Toolbar", which in turn has a child with
> name "Search or enter address".

These are exposed via accessibility APIs - Firefox has very
comprihensive support for assistive technology tools.  However...

> Using win32gui, I am able to get the handle of the Firefox window.
> However, then doing something like win32gui.EnumChildWindows to search
> through the windows of the Firefox window tells me that Firefox has no
> children.

That's because the controls inside the Firefox window are not natively
drawn.  Notice that every control picked up by inspect.exe has the same
window handle as the Firefox window itself.

> So, I am clearly thinking about this wrong -- how should I drill down to
> get a "handle" on the URL bar UI element? Once I get a "handle" on it, I
> intend to get its text (i.e. the current URL of the tab).

It might just be easier to parse the browser's session storage data
which is updated constantly and in JSON, although I'm not entirely sure
whether it's possible to gauge the currently displayed tab from that or
not.  Failing that, you'll need to investigate how to use the
accessibility APIs to get what you want, which will probably be more
difficult relative to using the window-related APIs you're used to.
-- 
James Scholes
http://twitter.com/JamesScholes
_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to