Is it possible to use webbrowser control outside a form ?
-
Hello, I would like to know if it is possible to use the webbrowser control just to navigate a webpage and then traverse its DOM, without creating a form and even in a console application ? Thanks, R. LOPES Just programmer.
Lookup a sample called WalkAll in MSDN.
-
Lookup a sample called WalkAll in MSDN.
-
Hello Stephane, Ok but WalkAll uses only the MSHTML component. I'm trying to use the WebBrowser control because it adds a lot of navigation stuff I would like not to take care of. Thanks, R. LOPES Just programmer.
:confused: UI --> iexplore.exe | web ocx no UI --> walkall Both have the DOM and the IWebBrowser interface (shdocvw) to play with.
-
:confused: UI --> iexplore.exe | web ocx no UI --> walkall Both have the DOM and the IWebBrowser interface (shdocvw) to play with.
-
Hello, Ok then. So what is the DLL I'm supposed to use ? Shdoccvw or mshtml ? Or both ? And what happens without any UI when a NewWindow event is trigerred ? Thanks, R. LOPES Just programmer.
GriffonRL wrote: Ok then. So what is the DLL I'm supposed to use ? Shdoccvw or mshtml ? Or both ? the primary dll is shdocvw which provides the url navigation. then, if you query interface and request the IHTMLDocument interface (if you want to play with the DOM), mshtml.dll is automatically loaded. GriffonRL wrote: I'm supposed to use ? :confused: You are using COM interfaces. Why should you bother about the DLLs themselves? GriffonRL wrote: And what happens without any UI when a NewWindow event is trigerred ? An event is what you make of it. The UI less sample in walk all does not register itself for events, so it will never receive them. If you want those events, you've got to add a look up on the COM server IConnectionPointContainer interface waiting for you. (there is sample code for that in Codeproject, MSDN, ...).
-
GriffonRL wrote: Ok then. So what is the DLL I'm supposed to use ? Shdoccvw or mshtml ? Or both ? the primary dll is shdocvw which provides the url navigation. then, if you query interface and request the IHTMLDocument interface (if you want to play with the DOM), mshtml.dll is automatically loaded. GriffonRL wrote: I'm supposed to use ? :confused: You are using COM interfaces. Why should you bother about the DLLs themselves? GriffonRL wrote: And what happens without any UI when a NewWindow event is trigerred ? An event is what you make of it. The UI less sample in walk all does not register itself for events, so it will never receive them. If you want those events, you've got to add a look up on the COM server IConnectionPointContainer interface waiting for you. (there is sample code for that in Codeproject, MSDN, ...).
Hello, I think I am missing something :(. I used to use the webbrowser control (shdocvw) for simpler programs because I understood mshtml was only the HTML parser/Javascript interpreter/DOM builder and I wanted to keep the UI. I know how to walk the DOM using the mshtml interfaces. But I don't know what kind of object I have to create from shdocvw to provide me with url navigation without the UI mess. I tried several things like creating WebBrowser,IWebBrowserApp,IWebBrowser2 interfaces but I get errors when calling the Navigate2 method (some COM exception) ! Forgive my ignorance but I am currently stuck and lost with all the interfaces/classes from shdocvw :wtf:. Any help, advice or link to relevant articles are welcome. Also for examples using the IConnectionPointContainer you are talking about. Thanks, R. LOPES Just programmer.