By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,876 Members | 1,191 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,876 IT Pros & Developers. It's quick & easy.

win32: internet explorer automation problem

P: n/a
mic
I'm currently trying to write an MSIE automation software and have run into
such problem - have no idea how to take control of external popup windows -
I use WebBrowser COM object and am able to catch the NewWindow2 event, but
don't know how to change 'focus' to other than main explorer window. I tried
to use winguiauto package and am able to get the HWND of the 'Internet
Explorer Server' control located in that new window, but I don't know
whether it is possible to force it to be my new COM object.

Regards,

Michal Zylinski
Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"mic" <al*****@onet.pl> writes:
I'm currently trying to write an MSIE automation software and have run into
such problem - have no idea how to take control of external popup windows -
I use WebBrowser COM object and am able to catch the NewWindow2 event, but
don't know how to change 'focus' to other than main explorer window. I tried

[...]

I guess you just need to use the usual browser object model (the one
exposed to JavaScript &c.) -- eg. window.focus(), window.blur().
IIRC, it's IHTMLDocument2, or similar, that you want.
John
Jul 18 '05 #2

P: n/a
mic
> I guess you just need to use the usual browser object model (the one
exposed to JavaScript &c.) -- eg. window.focus(), window.blur(). IIRC, it's IHTMLDocument2, or similar, that you want.


I don't think this could work - my piece of code is assumed to be completely
separated from the HTML itself. It just 'watches' the MSIE behaviour and
simulates the user work. AFAIK opening popup creates another MSIE instance,
so I simply loose the context. It'd be perfect if external window will be
treated using IHTMLDocument object model, but window object works according
to this excerpt from MSDN like this:

'Typically, the browser creates one window object when it opens an HTML
document. However, if a document defines one or more frames (that is,
contains one or more frame or iframe tags), the browser creates one window
object for the original document and one additional window object for each
frame'

So there is no easy way of doing it like
Document.NewWindow.documentelement.outerHTML. There is some ppDisp parameter
within OnNewWindow2 event, that looks like some sort of way to go...

Michal
Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.