Iframe が読み込まれたかどうかを HTML ドキュメントで識別したい。
これが私が試したことですが、これが 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;
}
}