Embed HTML browser into a native C++/Win32 project

2019-01-23 17:41发布

问题:

I have a C++ project in the MS Visual Studio 2008 IDE (note, NO MFC, NO .NET, just native Win32 APIs!) and I was wondering if it is possible to add to it a child window that can parse and render HTML/CSS/JavaScript, like a browser. It would be very good if that window did not have browser controls/buttons/borders -- if it just rendered HTML.

Is it a tall order to ask for such?

回答1:

You could embed an HTLM Browser (Internet Explorer) within your windows with some heavy use of COM. I used to do that and have the same need to avoid MFC, .NET, etc. This control is quite configurable, and you can remove and/or override pretty much anything.

I did my work based on an old article in The Code Project: http://www.codeproject.com/KB/COM/cwebpage.aspx