Note that there are some explanatory texts on larger screens.

plurals
  1. POc# webbrowser control displaying "special folder" contents : why are Document and DocumentDom always null?
    text
    copied!<p>In a C# WinForms, .NET Framework 3.5, project with a WebBrower control on the form :</p> <p>... with a project reference set to MSHTMLdll and the WinForm code : "using mshtml;" ...</p> <ol> <li><p>you can load a "special folder," like the Favorites folder, into the browser easily.</p></li> <li><p>after you've loaded a "special folder" : what appears in the WebBrowser is essentially a kind of "explorer" view : you have the choice of typical "explorer" view-styles of 'Details, etc. in Details view you have a row-column matrix, with typical "Explorer" style column heads, etc.</p></li> </ol> <p>Normally I would "get at" the DOM of the WebBrowser via casting the Document, or the DomDocument of the Document, to the IHTMLDocument2 interface exposed by mshtml.dll :</p> <p>IHTMLDocument2 HTMLDocument = (IHTMLDocument2)webBrowser1.Document;</p> <p>// also tried this </p> <p>// IHTMLDocument2 HTMLDocument = (IHTMLDocument2)webBrowser1.Document.DomDocument;</p> <p>// also tried this</p> <p>// HTMLDocumentClass HTMLDocument = webBrowser1.Document.DomDocument as HTMLDocumentClass; </p> <p>But in this case, viewing a "special folder" contents, I'm always getting the Document as null.</p> <p>It is interesting that you can while viewing a special folder, like the Favorites, create a new folder and do other "file ops" : I wonder if I am "getting away with this" because I have protected mode turned off on IE8 ?</p> <p>Appreciate any ideas about how to access the DOM while viewing special folder in the WebBrowser controls.</p> <p>thanks ! Bill</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload