Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

what´s the dif between mshtml and webbrowser?

0 views
Skip to first unread message

Joaquin Grech

unread,
Apr 13, 2002, 4:40:36 AM4/13/02
to
Hi!

I扉e got a question, I惴 trying to write a small chat client that will show
html code
(I can type in HTML code, add images, etc...)
What I did so far is added 1 webbrowser (where I show the html) and a
textbox where I type it in.

But I惴 having lot of trouble with the automatic scrolling (I have to scroll
it down when I type something new in)
and I惴 having trouble with the right click buttoms that I don愒 want to
show, some interfaces problems too, etc etc

So what愀 best for this? use webbrowser control to show the html or use
mshtml to show it?
Is there a difference? how can i host mshtml and manage scrolling?
do you think of a better way to achieve what I惴 trying?

By the way, I惴 writing using c# in case you got some examples :)

Joaquin Grech

Free irc webchat client at www.bocazas.com


Andreas Häber

unread,
Apr 13, 2002, 7:56:56 AM4/13/02
to
MSHTML is the HTML parse-enginge from MS Internet Explorer. The WebBrowser
control displays the parsed HTML.

"Programming Internet Explorer" by Scott Roberts - MS Press explains it very
well. I guess also the Platform SDK gives information about what they do.

So it depends on how much work you want to do.. some options you have is:
1. Use MSHTML to parse the HTML for you, and display it yourself some way.
2. Use the WebBrowser control to display the page. Then you can use the
Document property (get_Document actually) to get the IHTMLDocument2
interface which you can use to manipulate the page using MSHTML.

hth,
Andreas Häber

"Joaquin Grech" <crea...@bigfoot.com> wrote in message
news:OcHOtbs4BHA.2092@tkmsftngp02...
> Hi!
>
> I´ve got a question, I´m trying to write a small chat client that will


show
> html code
> (I can type in HTML code, add images, etc...)
> What I did so far is added 1 webbrowser (where I show the html) and a
> textbox where I type it in.
>

> But I´m having lot of trouble with the automatic scrolling (I have to


scroll
> it down when I type something new in)

> and I´m having trouble with the right click buttoms that I don´t want to


> show, some interfaces problems too, etc etc
>

> So what´s best for this? use webbrowser control to show the html or use


> mshtml to show it?
> Is there a difference? how can i host mshtml and manage scrolling?

> do you think of a better way to achieve what I´m trying?
>
> By the way, I´m writing using c# in case you got some examples :)

Carl Daniel

unread,
Apr 13, 2002, 10:42:48 AM4/13/02
to
"Andreas Häber" <a-ha...@frisurf.no> wrote in message
news:ONemLJu4BHA.2072@tkmsftngp02...

> MSHTML is the HTML parse-enginge from MS Internet Explorer. The WebBrowser
> control displays the parsed HTML.
>
> "Programming Internet Explorer" by Scott Roberts - MS Press explains it
very
> well. I guess also the Platform SDK gives information about what they do.
>
> So it depends on how much work you want to do.. some options you have is:
> 1. Use MSHTML to parse the HTML for you, and display it yourself some way.
> 2. Use the WebBrowser control to display the page. Then you can use the
> Document property (get_Document actually) to get the IHTMLDocument2
> interface which you can use to manipulate the page using MSHTML.
>

That's not a completely accurate description of the distinction - MSHTML
also displays HTML. From the MSDN library
(http://msdn.microsoft.com/workshop/browser/webbrowser/WebBrowser.asp):

The WebBrowser control adds browsing, document viewing, and data downloading
capabilities to your applications. Applications using this control will
allow the user to browse sites on the Internet's World Wide Web, as well as
folders in the local file system and on a network. The WebBrowser control
supports Web browsing through both point-and-click hyperlinking and URL
navigation. The control maintains a history list that allows the user to
browse forward and backward through previously browsed sites, folders, and
documents.

The parsing and rendering of HTML documents in the WebBrowser control is
handled by the MSHTML component of Microsoft® Internet Explorer 4.0 and
later. The MSHTML component is an Active Document (also known as a
DocObject) that provides support for parsing and rendering HTML, exposes the
Dynamic HTML (DHTML) Object Model, and hosts Microsoft ActiveX® Controls and
script languages. See Reusing MSHTML for details about directly hosting the
MSHTML component in your application. The WebBrowser control acts as a
container for the MSHTML component and implements navigation, hyperlinking,
history lists, favorites, and security. Applications can also use the
WebBrowser control to host Active Documents other than MSHTML. This means
that richly formatted documents, such as Microsoft Excel spreadsheets or
Microsoft Word documents, can be opened and edited in place from within the
WebBrowser control.

HTH

-cd

Joaquin Grech

unread,
Apr 13, 2002, 10:54:43 AM4/13/02
to

so I guess I should use mshtml directly... but how can I host it using c# ?
I only find docs to host the webbrowser but not to host mshtml directly and
control scrolling...

"Carl Daniel" <cpda...@pacbell.net> wrote in message
news:Oeck8lv4BHA.1260@tkmsftngp07...

0 new messages