IE四个接口互相获取

时间:2022-02-23 20:23:16
IE(控件/接口)中主要有4个部分, Browser, Document, Frame/IFrame, Element , 其对应接口分别是 
Browser          -     IWebBrowser2
Document       -     IHTMLDocument2
Frame/IFrame-     IHTMLWindow2
Element          -     IHTMLElement
可以通过下面方法互相获取 
browser      -> document        IWebBrowser2::get_Document
document     -> frame           IHTMLDocument2::get_parentWindow
frame        -> document        IHTMLWindow2::get_document
frame        -> parent frame    IHTMLWindow2::get_parent
frame        -> children frames IHTMLWindow2::get_frames
element     -> Frame              IHTMLElement->QI(IHTMLFrameBase2) -> IHTMLFrameBase2->get_contentWindow -> IHTMLWindow2 ->
+ View Code?HtmlWindowToHtmlWebBrowser -> IWebBrowser2