Currently there is no support (from what I've seen) for attaching watir to an embedded IE window. Several users have had a need for this and I've done some research on the issue but have not yet been able to get a working solution.
What would be nice is to add a new method to watir called something like attach_embedded(how, what)
where how could be :title or :hwnd
and what being the corresponding value
autoit has a function for attaching to an embedded browser and I've tested that it works. Thus, In autoit IE.au3 they have a function which when given a hwnd will return the IE control which if we could do the same thing with watir, we could bind that and control it like a regular browser.
The following has the source for IE.au3, if you look there is a function called __IEControlGetObjFromHWND
which is what I am referring to. Check it out: http://www.therks.com/autoit/install/Include/IE.au3
A few people have attempted to implement this function but have been unable to call the idispatch interface method that is returned (at least, thats what i think the problem is). Here is the most recent attempt which didnt work in my tests: http://rubyforge.org/forum/forum.php?thread_id=33188&forum_id=319
I've compiled some useful links about the issue and I'll post them here:
bret added a comment - 25/Nov/09 10:37 PM Thanks for pulling together this information. I know there are a lot of people who have asked how to make this work.
Thanks for pulling together this information. I know there are a lot of people who have asked how to make this work.