Mainly uses the iwebbrowser interface. Specific can refer to the following blog: http://blog.csdn.net/shanhe/article/details/397373
CodeAs follows:
# Include <windows. h> # include <exdisp. h> # include <assert. h ># include <iostream> using namespace STD; int main () {hresult hr; iwebbrowser2 * pwebbrowser2 = NULL; oleinitialize (null); HR = cocreateinstance (response, null, clsctx_local_server, struct, (void **) & pwebbrowser2); Assert (succeeded (HR); variant vempty; variantinit (& vempty); BSTR bstrurl = sysallocstring (L "http://www.baidu.cn "); hR = pwebbrowser2-> navigate (bstrurl, & vempty, & vempty); If (HR) {pwebbrowser2-> put_visible (variant_true ); // pwebbrowser2-> put_fullscreen (variant_true); // pwebbrowser2-> put_width (200); sleep (3000); pwebbrowser2-> refresh (); pwebbrowser2-> Gohome ();} else {pwebbrowser2-> quit ();} sysfreestring (bstrurl); pwebbrowser2-> release (); oleuninitialize (); Return 0 ;}