private static DispHTMLDocument getDocumentByFrame(DispHTMLDocument doc, String frameData) { try { FramesCollection frames = Helper.getHelper().getDocumentProperty("frames") as FramesCollection; int index; if (Int32.TryParse(frameData, out index) && frames.length >= index) { return(getFrameDocument(frames.item(index) as IHTMLWindow2)); } else { for (int i = 0; i < frames.length; i++) { Object frameObject = frames.item(i); IHTMLWindow2 frame = (IHTMLWindow2)frameObject; if (frame.name.Equals(frameData)) { frameObject = CrossFrameIE.GetDocumentFromWindow(frame).activeElement.document as DispHTMLDocument; return((DispHTMLDocument)frameObject); } } } } catch { } return(doc); }
private IHTMLDocument3 parseFrameDocument(int index) { object refIndex = (object)index; IHTMLDocument2 htmlDoc = (IHTMLDocument2)webBrowser.Document.DomDocument; IHTMLWindow2 target_mshtmlIHTMLWindow = (IHTMLWindow2)htmlDoc.frames.item(ref refIndex); IHTMLDocument2 target_mshtmlIHTMLDoc = CrossFrameIE.GetDocumentFromWindow(target_mshtmlIHTMLWindow); IHTMLDocument3 doc3 = (IHTMLDocument3)target_mshtmlIHTMLDoc; return(doc3); }
private static DispHTMLDocument getFrameDocument(IHTMLWindow2 frame) { Object frameObject = CrossFrameIE.GetDocumentFromWindow(frame).activeElement.document as DispHTMLDocument; return((DispHTMLDocument)frameObject); }