I want identify in an HTML document whether an Iframe has loaded or not.
Here is what I tried, but I am pretty not sure if this is the right way to identify the loading of IFrame:
var myhtmlDocument = (IHTMLDocument2) HtmlDocument.DomDocument;
IHTMLSelectionObject htmlselectionObject = myhtmlDocument.selection;
bool frameloaded = false;
if (htmlselectionObject != null)
{
FramesCollection frames = myhtmlDocument.frames;
IHTMLSelectionObject frameSelection = frame.document.selection;
for (int i = 0; i < frames.length; i++)
{
object index = i;
IHTMLWindow2 frame = (IHTMLWindow2) frames.item(ref index);
IHTMLSelectionObject frameSelection = frame.document.selection;
if(frameSelection)
frameloaded = true;
}
}