CHtmlView
class
Provides the functionality of the WebBrowser control within the context of MFC's document/view architecture.
class CHtmlView : public CFormView
Name | Description |
---|---|
CHtmlView::Create |
Creates the WebBrowser control. |
CHtmlView::CreateControlSite |
Overridable used to create a control site instance to host a control on the form. |
CHtmlView::ExecFormsCommand |
Executes the specified command using the IOleCommandTarget::Exec method. |
CHtmlView::ExecWB |
Executes a command. |
CHtmlView::GetAddressBar |
Determines if the Internet Explorer object's address bar is visible. (WebBrowser control ignores; Internet Explorer only.) |
CHtmlView::GetApplication |
Retrieves an application object representing the application that contains the current instance of the Internet Explorer application. |
CHtmlView::GetBusy |
Retrieves a value indicating whether a download or other activity is still in progress. |
CHtmlView::GetContainer |
Retrieves the container of the WebBrowser control. |
CHtmlView::GetFullName |
Retrieves the full name, including the path, of the resource displayed in the web browser. (WebBrowser control ignores; Internet Explorer only.) |
CHtmlView::GetFullScreen |
Indicates whether the WebBrowser control is operating in full-screen mode or in normal window mode. |
CHtmlView::GetHeight |
Retrieves the height of the Internet Explorer main window. |
CHtmlView::GetHtmlDocument |
Retrieves the active HTML document. |
CHtmlView::GetLeft |
Retrieves the screen coordinate of the left edge of the Internet Explorer main window. |
CHtmlView::GetLocationName |
Retrieves the name of the resource that WebBrowser is currently displaying |
CHtmlView::GetLocationURL |
Retrieves the URL of the resource that WebBrowser is currently displaying. |
CHtmlView::GetMenuBar |
Retrieves a value that determines whether the menu bar is visible. |
CHtmlView::GetOffline |
Retrieves a value that determines whether the control is offline. |
CHtmlView::GetParentBrowser |
Retrieves a pointer to the IDispatch interface. For more information, see Implementing the IDispatch Interface. |
CHtmlView::GetProperty |
Retrieves the current value of a property associated with the given object. |
CHtmlView::GetReadyState |
Retrieves the ready state of the web browser object. |
CHtmlView::GetRegisterAsBrowser |
Indicates whether the WebBrowser control is registered as a top-level browser for target name resolution. |
CHtmlView::GetRegisterAsDropTarget |
Indicates whether the WebBrowser control is registered as a drop target for navigation. |
CHtmlView::GetSilent |
Indicates whether any dialog boxes can be shown. |
CHtmlView::GetSource |
The HTML source code of the web page. |
CHtmlView::GetStatusBar |
Indicates whether the Internet Explorer's status bar is visible. (WebBrowser control ignores; Internet Explorer only.) |
CHtmlView::GetTheaterMode |
Indicates whether the WebBrowser control is in theater mode. |
CHtmlView::GetToolBar |
Retrieves a value that determines whether the toolbar is visible. |
CHtmlView::GetTop |
Retrieves the screen coordinate of the top edge of the Internet Explorer main window. |
CHtmlView::GetTopLevelContainer |
Retrieves a value indicating whether the current object is the top-level container of the WebBrowser control. |
CHtmlView::GetType |
Retrieves the type name of the document object. |
CHtmlView::GetVisible |
Retrieves a value indicating whether the object is visible or hidden. |
CHtmlView::GetWidth |
Retrieves the width of the Internet Explorer main window. |
CHtmlView::GoBack |
Navigates to the previous item in the history list. |
CHtmlView::GoForward |
Navigates to the next item in the history list. |
CHtmlView::GoHome |
Navigates to the current home or start page. |
CHtmlView::GoSearch |
Navigates to the current search page. |
CHtmlView::LoadFromResource |
Loads a resource in the WebBrowser control. |
CHtmlView::Navigate |
Navigates to the resource identified by a URL. |
CHtmlView::Navigate2 |
Navigates to the resource identified by a URL, or to the file identified by a full path. |
CHtmlView::OnBeforeNavigate2 |
Called before a navigation operation occurs in the given WebBrowser (on either a window or frameset element). |
CHtmlView::OnCommandStateChange |
Called to notify an application that the enabled state of a web browser command has changed. |
CHtmlView::OnDocumentComplete |
Called to notify an application that a document has reached the READYSTATE_COMPLETE state. |
CHtmlView::OnDocWindowActivate |
Called from the Internet Explorer or MSHTML implementation of IOleInPlaceActiveObject::OnDocWindowActivate , which notifies the active in-place object when the container's document window is activated or deactivated. |
CHtmlView::OnDownloadBegin |
Called to notify an application that a navigation operation is beginning. |
CHtmlView::OnDownloadComplete |
Called when a navigation operation finished, was halted, or failed. |
CHtmlView::OnEnableModeless |
Called to enable or disable modeless dialog boxes when the container creates or destroys a modal dialog box. |
CHtmlView::OnFilterDataObject |
Called on the host by Internet Explorer or MSHTML to allow the host to replace Internet Explorer or MSHTML's data object. |
CHtmlView::OnFrameWindowActivate |
Called from IOleInPlaceActiveObject::OnFrameWindowActivate to notify the object when the container's top-level frame window is activated or deactivated. |
CHtmlView::OnFullScreen |
Called when the FullScreen property has changed. |
CHtmlView::OnGetDropTarget |
Called by Internet Explorer or MSHTML when it's being used as a drop target to allow the host to supply an alternative IDropTarget . |
CHtmlView::OnGetExternal |
Called by Internet Explorer or MSHTML to obtain the host's IDispatch interface. |
CHtmlView::OnGetHostInfo |
Retrieves the UI capabilities of the Internet Explorer or MSHTML host. |
CHtmlView::OnGetOptionKeyPath |
Returns the registry key under which Internet Explorer or MSHTML stores user preferences. |
CHtmlView::OnHideUI |
Called when Internet Explorer or MSHTML removes its menus and toolbars. |
CHtmlView::OnMenuBar |
Called when the MenuBar property has changed. |
CHtmlView::OnNavigateComplete2 |
Called after navigation to a hyperlink completes (on either a window or frameset element). |
CHtmlView::OnNavigateError |
Called by the framework if navigation to a hyperlink fails. |
CHtmlView::OnNewWindow2 |
Called when a new window is to be created for displaying a resource. |
CHtmlView::OnProgressChange |
Called to notify an application that the progress of a download operation has been updated. |
CHtmlView::OnPropertyChange |
Called to notify an application that the PutProperty method has changed the value of a property. |
CHtmlView::OnQuit |
Called to notify an application that the Internet Explorer application is ready to quit. (Applies to Internet Explorer only) |
CHtmlView::OnResizeBorder |
Called from the Internet Explorer or MSHTML implementation of IOleInPlaceActiveObject::ResizeBorder , which alerts the object that it needs to resize its border space. |
CHtmlView::OnShowContextMenu |
Called from Internet Explorer or MSHTML when it's about to show its context menu. |
CHtmlView::OnShowUI |
Called before Internet Explorer or MSHTML displays its menus and toolbars. |
CHtmlView::OnStatusBar |
Called when the StatusBar property has changed. |
CHtmlView::OnStatusTextChange |
Called to notify an application that the text of the status bar associated with the WebBrowser control has changed. |
CHtmlView::OnTheaterMode |
Called when the TheaterMode property has changed. |
CHtmlView::OnTitleChange |
Called to notify an application if the title of a document in the WebBrowser control becomes available or changes. |
CHtmlView::OnToolBar |
Called when the ToolBar property has changed. |
CHtmlView::OnTranslateAccelerator |
Called by Internet Explorer or MSHTML when IOleInPlaceActiveObject::TranslateAccelerator or IOleControlSite::TranslateAccelerator is called to process menu accelerator-key messages from the container's message queue. |
CHtmlView::OnTranslateUrl |
Called by Internet Explorer or MSHTML to allow the host an opportunity to modify the URL to be loaded. |
CHtmlView::OnUpdateUI |
Notifies the host that the command state has changed. |
CHtmlView::OnVisible |
Called when the window for the WebBrowser control should be shown/hidden. |
CHtmlView::PutProperty |
Sets the value of a property associated with the given object. |
CHtmlView::QueryFormsCommand |
Queries for the status of one or more commands generated by user interface events. |
CHtmlView::QueryStatusWB |
Queries the status of a command being processed by the WebBrowser control. |
CHtmlView::Refresh |
Reloads the current file. |
CHtmlView::Refresh2 |
Reloads the current file and optionally prevents the pragma:nocache header from being sent. |
CHtmlView::SetAddressBar |
Shows or hides the Internet Explorer object's address bar. (WebBrowser control ignores; Internet Explorer only.) |
CHtmlView::SetFullScreen |
Sets a value to determine whether the control is operating in full-screen mode or in normal window mode. (WebBrowser control ignores; Internet Explorer only.) |
CHtmlView::SetHeight |
Sets the height of the Internet Explorer main window. |
CHtmlView::SetLeft |
Sets the horizontal position of the Internet Explorer main window. |
CHtmlView::SetMenuBar |
Sets a value to determine whether the control's menu bar is visible. (WebBrowser control ignores; Internet Explorer only.) |
CHtmlView::SetOffline |
Sets a value to determine whether the control is offline. |
CHtmlView::SetRegisterAsBrowser |
Sets a value indicating whether the WebBrowser control is registered as a top-level browser for target name resolution. |
CHtmlView::SetRegisterAsDropTarget |
Sets a value indicating whether the WebBrowser control is registered as a drop target for navigation. |
CHtmlView::SetSilent |
Sets a value to determine whether the control will display dialog boxes. |
CHtmlView::SetStatusBar |
Sets a value to determine whether the Internet Explorer's status bar is visible. (WebBrowser control ignores; Internet Explorer only.) |
CHtmlView::SetTheaterMode |
Sets a value indicating whether the WebBrowser control is in theater mode. |
CHtmlView::SetToolBar |
Sets a value to determine whether the control's toolbar is visible. (WebBrowser control ignores; Internet Explorer only.) |
CHtmlView::SetTop |
Sets the vertical position of the Internet Explorer main window. |
CHtmlView::SetVisible |
Sets a value indicating whether the object is visible or hidden. |
CHtmlView::SetWidth |
Sets the width of the Internet Explorer main window. |
CHtmlView::Stop |
Stops opening a file. |
The WebBrowser control is a window in which the user can browse sites on the World Wide Web, and folders in the local file system and on a network. The WebBrowser control supports hyperlinking, Uniform Resource Locator (URL) navigation, and maintains a history list.
In the standard MFC framework application (either SDI or MDI based), the view object is commonly derived from a specialized set of classes. These classes, all derived from CView
, provide specialized functionality beyond that provided by CView
.
Basing the application's view class on CHtmlView
provides the view with the WebBrowser control. This effectively makes the application a web browser. The preferred method of creating a web browser-style application is to use the MFC Application Wizard, and specify CHtmlView
as the view class. For more information on implementing and using the WebBrowser control within MFC applications, see Creating a Web Browser-Style Application.
Note
The WebBrowser ActiveX control (and therefore CHtmlView
) is available only to programs running under Windows NT versions 4.0 or later, in which Internet Explorer 4.0 or later has been installed.
CHtmlView
is designed for applications that access the Web (and/or HTML documents). The following CHtmlView
member functions apply to the Internet Explorer application only. These functions will succeed on the WebBrowser control, but they'll have no visible effect.
GetAddressBar
GetFullName
GetStatusBar
SetAddressBar
SetFullScreen
SetMenuBar
SetStatusBar
SetToolBar
CObject
CCmdTarget
CWnd
CView
CScrollView
CFormView
CHtmlView
Header: afxhtml.h
Call this member function to create a WebBrowser control or container for the Internet Explorer executable.
virtual BOOL Create(
LPCTSTR lpszClassName,
LPCTSTR lpszWindowName,
DWORD dwStyle,
const RECT& rect,
CWnd* pParentWnd,
UINT nID,
CCreateContext* pContext = NULL);
lpszClassName
Points to a null-terminated character string that names the Windows class. The class name can be any name registered with the AfxRegisterWndClass
global function or the RegisterClass
Windows function. If NULL
, uses the predefined default CFrameWnd
attributes.
lpszWindowName
Points to a null-terminated character string that represents the window name.
dwStyle
Specifies the window style attributes. By default, the WS_VISIBLE
and WS_CHILD
Windows styles are set.
rect
A reference to a RECT
structure specifying the size and position of the window. The rectDefault
value allows Windows to specify the size and position of the new window.
pParentWnd
A pointer to the parent window of the control.
nID
The ID number of the view. By default, set to AFX_IDW_PANE_FIRST
.
pContext
A pointer to a CCreateContext
. NULL
by default.
Overridable used to create a control site instance to host a control on the form.
virtual BOOL CreateControlSite(
COleControlContainer* pContainer,
COleControlSite** ppSite,
UINT nID,
REFCLSID clsid);
pContainer
A pointer to a COleControlContainer
object containing the control.
ppSite
A pointer to a pointer to a COleControlSite
object, providing the site for the control.
nID
The identifier of the control to be hosted.
clsid
The CLSID of the control to be hosted
Returns TRUE
on success, FALSE
on failure.
You can override this member function to return an instance of your own control site class.
Executes the specified command using the IOleCommandTarget::Exec
method.
HRESULT ExecFormsCommand(
DWORD dwCommandID,
VARIANT* pVarIn,
VARIANT* pVarOut);
dwCommandID
The command to be executed. This command must belong to the CMDSETID3_Forms3
group.
pVarIn
Pointer to a VARIANT
structure containing input arguments. Can be NULL
.
pVarOut
Pointer to a VARIANT
structure to receive command output. Can be NULL
.
A standard HRESULT
value. For a complete listing of possible values, see IOleCommandTarget::Exec
in the Windows SDK.
ExecFormsCommand
implements the behavior of the IOleCommandTarget::Exec
method.
Call this member function to execute a command in the WebBrowser or Internet Explorer.
void ExecWB(
OLECMDID cmdID,
OLECMDEXECOPT cmdexecopt,
VARIANT* pvaIn,
VARIANT* pvaOut);
cmdID
The command to execute.
cmdexecopt
The options set for executing the command.
pvaIn
A variant used for specifying command input arguments.
pvaOut
A variant used for specifying command output arguments.
See IWebBrowser2::ExecWB
in the Windows SDK.
Call this member function to retrieve Internet Explorer's address bar.
BOOL GetAddressBar() const;
Nonzero if the address bar is visible; otherwise zero.
Applies to Internet Explorer. If you use this call with a WebBrowser control, it will return no error, but it will ignore this call.
Call this member function to retrieve the automation object supported by the application that contains the WebBrowser control.
LPDISPATCH GetApplication() const;
A pointer to the IDispatch
interface of the active document object. For more information, see Implementing the IDispatch
Interface.
Applies to Internet Explorer and WebBrowser.
Call this member function to determine whether the WebBrowser control is engaged in a navigation or downloading operation.
BOOL GetBusy() const;
Nonzero if the web browser is busy; otherwise zero.
Applies to Internet Explorer and WebBrowser.
Call this member function to retrieve an object that evaluates to the container of the web browser.
LPDISPATCH GetContainer() const;
A pointer to the IDispatch
interface of the active document object.
Applies to Internet Explorer and WebBrowser.
Call this member function to retrieve the full path of the file that Internet Explorer is currently displaying.
CString GetFullName() const;
A CString
object containing the path and name of the currently displayed file. If no path and filename exist, GetFullName
returns an empty CString
.
Applies to Internet Explorer. If you use this call with a WebBrowser control, it will return no error, but it will ignore this call.
Call this member function to determine whether the WebBrowser control is operating in full-screen mode or in normal window mode.
BOOL GetFullScreen() const;
Nonzero if the WebBrowser is operating in full-screen mode; otherwise zero.
In full-screen mode, the Internet Explorer main window is maximized and the status bar, toolbar, menu bar, and title bar are hidden.
Applies to Internet Explorer and WebBrowser.
Call this member function to retrieve the height, in pixels, of the WebBrowser control's frame window.
long GetHeight() const;
The control's frame window height, in pixels.
Call this member function to retrieve the HTML document for the active document.
LPDISPATCH GetHtmlDocument() const;
A pointer to the IDispatch
interface of the active document object.
Applies to Internet Explorer and WebBrowser.
Call this member function to retrieve the distance between the internal left edge of the WebBrowser control and the left edge of its container.
long GetLeft() const;
The left-edge distance, in pixels.
Applies to Internet Explorer and WebBrowser.
Call this member function to get the name of the resource being displayed in the WebBrowser.
CString GetLocationName() const;
A CString
object containing the name of the resource currently displayed in the WebBrowser.
If the resource is an HTML page on the World Wide Web, the name is the title of that page. If the resource is a folder or file on the network or local computer, the name is the UNC or full path of the folder or file.
Applies to Internet Explorer and WebBrowser.
Call this member function to retrieve the URL of the resource that the WebBrowser control is currently displaying.
CString GetLocationURL() const;
A CString
object containing the URL of the resource currently displayed in the WebBrowser.
If the resource is a folder or file on the network or local computer, the name is the UNC or full path of the folder or file.
Applies to Internet Explorer and WebBrowser.
Call this member function to determine whether the menu bar is visible.
BOOL GetMenuBar() const;
Nonzero if the menu bar is visible; otherwise zero.
Applies to Internet Explorer and WebBrowser.
Call this member function to determine whether the web browser is operating offline.
BOOL GetOffline() const;
Nonzero if the web browser is currently offline; otherwise zero.
Applies to Internet Explorer and WebBrowser.
Call this member function to retrieve a pointer to the parent object of the WebBrowser control.
LPDISPATCH GetParentBrowser() const;
A pointer to the IDispatch
interface of the object that is the parent of the WebBrowser control.
Applies to Internet Explorer and WebBrowser.
Call this member function to get the value of the property currently associated with the control.
BOOL GetProperty(
LPCTSTR lpszProperty,
CString& strValue);
COleVariant GetProperty(LPCTSTR lpszProperty);
lpszProperty
A pointer to a string containing the property to retrieve.
strValue
A reference to a CString
object that receives the current value of the property.
In the first version, nonzero if completed successfully; otherwise zero. In the second version, a COleVariant
object.
Applies to Internet Explorer and WebBrowser.
Call this member function to retrieve the ready state of the WebBrowser object.
READYSTATE GetReadyState() const;
A READYSTATE
value, as described in the Windows SDK.
Applies to Internet Explorer and WebBrowser.
Call this member function to determine whether the WebBrowser object is registered as a top-level browser for target name resolution.
BOOL GetRegisterAsBrowser() const;
Nonzero if the browser is registered as a top-level browser; otherwise zero.
Applies to Internet Explorer and WebBrowser.
Call this member function to determine whether the WebBrowser control is registered as a drop target for navigation.
BOOL GetRegisterAsDropTarget() const;
Nonzero if the browser is registered as a drop target; otherwise zero.
Applies to Internet Explorer and WebBrowser.
Call this member function to determine whether any dialog boxes can be shown in the WebBrowser control.
BOOL GetSilent() const;
Nonzero if dialog boxes can't be displayed from the WebBrowser control; otherwise zero.
Applies to Internet Explorer and WebBrowser.
Call this member function to retrieve the HTML source code for the web page.
BOOL GetSource(CString& strRef);
Nonzero if successful; otherwise zero.
refString
A CString
that will hold the source code.
This function is equivalent to the "View Source" command in Internet Explorer, except that the source code is returned in a CString
.
Call this member function to determine whether the WebBrowser control displays a status bar.
BOOL GetStatusBar() const;
Nonzero if the status bar can be displayed; otherwise zero.
Applies to Internet Explorer. If you use this call with a WebBrowser control, it will return no error, but it will ignore this call.
Call this member function to determine whether the web browser is in theater mode.
BOOL GetTheaterMode() const;
Nonzero if the web browser is in theater mode; otherwise zero.
When the web browser is in theater mode, the browser main window fills the entire screen, a toolbar with a minimal set of navigational tools appears, and the status bar appears in the upper right-hand corner of the screen.
Applies to Internet Explorer and WebBrowser.
Call this member function to determine whether the toolbar is visible.
int GetToolBar() const;
A value indicating whether the toolbar is visible. Nonzero if toolbar is visible; otherwise zero.
Call this member function to retrieve the screen coordinate of the top edge of the WebBrowser control's main window.
long GetTop() const;
Address of a variable that receives the screen coordinate of the main window's top edge.
Applies to Internet Explorer and WebBrowser.
Call this member function to determine whether Internet Explorer is the top-level container of the WebBrowser control.
BOOL GetTopLevelContainer() const;
Nonzero the container is the top-level container; otherwise zero.
Applies to Internet Explorer and WebBrowser.
Call this member function to retrieve the type name of the contained active document.
CString GetType() const;
A CString
object containing the type name of the contained active document.
Applies to Internet Explorer and WebBrowser.
Call this member function to determine if the contained object is visible.
BOOL GetVisible() const;
Nonzero if the object is visible; otherwise zero.
Applies to Internet Explorer and WebBrowser.
Retrieves the width of the Internet Explorer main window.
long GetWidth() const;
The current width of the window, in pixels.
Navigates backward one item in the history list.
void GoBack();
Applies to Internet Explorer and WebBrowser.
Navigates forward one item in the history list.
void GoForward();
Navigates to the current home or start page specified in the Internet Explorer Internet Options dialog box or the Internet Properties dialog box, accessed from the Control Panel.
void GoHome();
Applies to Internet Explorer and WebBrowser.
Navigates to the current search page, as specified in the Internet Explorer Internet Options dialog box or the Internet Properties dialog box, accessed from the Control Panel.
void GoSearch();
Applies to Internet Explorer and WebBrowser.
Call this member function to load the specified resource into the WebBrowser control.
BOOL LoadFromResource(LPCTSTR lpszResource);
BOOL LoadFromResource(UINT nRes);
lpszResource
A pointer to a string containing the name of the resource to load.
nRes
The ID of the buffer containing the name of the resource to load.
Nonzero if successful; otherwise zero.
Applies to Internet Explorer and WebBrowser.
Call this member function to navigate to the resource identified by a URL.
void Navigate(
LPCTSTR URL,
DWORD dwFlags = 0,
LPCTSTR lpszTargetFrameName = NULL,
LPCTSTR lpszHeaders = NULL,
LPVOID lpvPostData = NULL,
DWORD dwPostDataLen = 0);
URL
A caller-allocated string that contains the URL to navigate to, or the full path of the file to display.
dwFlags
The flags of a variable that specifies whether to add the resource to the history list, whether to read to or write from the cache, and whether to display the resource in a new window. The variable can be a combination of the values defined by the BrowserNavConstants
enumeration.
lpszTargetFrameName
A pointer to a string that contains the name of the frame in which to display the resource.
lpszHeaders
A pointer to a value that specifies the HTTP headers to send to the server. These headers are added to the default Internet Explorer headers. The headers can specify such things as the action required of the server, the type of data being passed to the server, or a status code. This parameter is ignored if URL
isn't an HTTP URL.
lpvPostData
A pointer to the data to send with the HTTP POST transaction. For example, the POST transaction is used to send data gathered by an HTML form. If this parameter doesn't specify any post data, Navigate
issues an HTTP GET transaction. This parameter is ignored if URL
isn't an HTTP URL.
dwPostDataLen
Data to send with the HTTP POST transaction. For example, the POST transaction is used to send data gathered by an HTML form. If this parameter doesn't specify any post data, Navigate
issues an HTTP GET transaction. This parameter is ignored if URL
isn't an HTTP URL.
Applies to Internet Explorer and WebBrowser.
Call this member function to navigate to the resource identified by a URL, or to the file identified by a full path.
void Navigate2(
LPITEMIDLIST pIDL,
DWORD dwFlags = 0,
LPCTSTR lpszTargetFrameName = NULL);
void Navigate2(
LPCTSTR lpszURL,
DWORD dwFlags = 0,
LPCTSTR lpszTargetFrameName = NULL,
LPCTSTR lpszHeaders = NULL,
LPVOID lpvPostData = NULL,
DWORD dwPostDataLen = 0);
void Navigate2(
LPCTSTR lpszURL,
DWORD dwFlags,
CByteArray& baPostedData,
LPCTSTR lpszTargetFrameName = NULL,
LPCTSTR lpszHeader = NULL);
pIDL
A pointer to an ITEMIDLIST
structure.
dwFlags
The flags of a variable that specifies whether to add the resource to the history list, whether to read to or write from the cache, and whether to display the resource in a new window. The variable can be a combination of the values defined by the BrowserNavConstants
enumeration.
lpszTargetFrameName
A pointer to a string that contains the name of the frame in which to display the resource.
lpszURL
A pointer to a string containing the URL.
lpvPostData
Data to send with the HTTP POST transaction. For example, the POST transaction is used to send data gathered by an HTML form. If this parameter doesn't specify any post data, Navigate2
issues an HTTP GET transaction. This parameter is ignored if URL
isn't an HTTP or HTTPS URL.
dwPostDataLen
Length in bytes of the data pointed to by the lpvPostData
parameter.
lpszHeaders
A pointer to a value that specifies the HTTP or HTTPS headers to send to the server. These headers are added to the default Internet Explorer headers. The headers can specify such things as the action required of the server, the type of data being passed to the server, or a status code. This parameter is ignored if URL
isn't an HTTP or HTTPS URL.
baPostedData
A reference to a CByteArray
object.
This member function extends the Navigate
member function by supporting browsing on special folders, such as Desktop and My Computer, that are represented by the parameter pIDL
.
Applies to Internet Explorer and WebBrowser.
void CMyHtmlView::OnGoToMicrosoft()
{
Navigate2(_T("http://home.microsoft.com"));
}
This member function is called by the framework to cause an event to fire before a navigation operation occurs in the web browser.
virtual void OnBeforeNavigate2(
LPCTSTR lpszURL,
DWORD nFlags,
LPCTSTR lpszTargetFrameName,
CByteArray& baPostedData,
LPCTSTR lpszHeaders,
BOOL* pbCancel);
lpszURL
Pointer to a string containing the URL to navigate to.
nFlags
Reserved for future use.
lpszTargetFrameName
A string that contains the name of the frame in which to display the resource, or NULL
if no named frame is targeted for the resource.
baPostedData
A reference to a CByteArray
object containing the data to send to the server if the HTTP POST transaction is being used.
lpszHeaders
A pointer to a string containing other HTTP headers to send to the server (HTTP URLs only). The headers can specify such things as the action required of the server, the type of data being passed to the server, or a status code.
pbCancel
A pointer to a cancel flag. An application can set this parameter to nonzero to cancel the navigation operation, or to zero to allow it to continue.
This member function is called by the framework to notify an application that the enabled state of a web browser command has changed.
virtual void OnCommandStateChange(
long nCommand,
BOOL bEnable);
nCommand
Identifier of the command whose enabled state has changed.
bEnable
Enabled state. This parameter is nonzero if the command is enabled, or zero if it's disabled.
This member function is called by the framework to notify an application that a document has reached the READYSTATE_COMPLETE
state.
virtual void OnDocumentComplete(LPCTSTR lpszURL);
lpszURL
A pointer to a string that evaluates to the URL, UNC file name, or a PIDL (a pointer to an item identifier list) that was navigated to.
Not every frame will fire this event, but each frame that fires an OnDownloadBegin
event will fire a corresponding OnDocumentComplete
event.
The URL indicated by lpszURL
can be different from the URL that the browser was told to navigate to, because this URL is the canonicalized and qualified URL. For example, if an application specifies a URL of "www.microsoft.com"
in a call to Navigate
or Navigate2
, the URL passed by OnNavigateComplete2
will be "<https://www.microsoft.com/>"
. Also, if the server has redirected the browser to a different URL, the redirected URL will be reflected here.
Called from the Internet Explorer or MSHTML implementation of IOleInPlaceActiveObject::OnDocWindowActivate
, which notifies the active in-place object when the container's document window is activated or deactivated.
virtual HRESULT OnDocWindowActivate(BOOL fActivate);
fActivate
Indicates the state of the document window. If this value is nonzero, the window is being activated. If this value is zero, the window is being deactivated.
S_OK
if successful, or an OLE-defined error code otherwise.
Override OnDocWindowActivate
to react to the OnDocWindowActivate
notification from the Microsoft Web Browser control. See IDocHostUIHandler::OnDocWindowActivate
in the Windows SDK for more information.
This member function is called by the framework to begin downloading a document.
virtual void OnDownloadBegin();
This event is fired shortly after the OnBeforeNavigate2
event, unless the navigation is canceled. Any animation or "busy" indication that the container needs to display should be connected to this event.
This member function is called by the framework to indicate that a navigation operation finished, was halted, or failed.
virtual void OnDownloadComplete();
Called when Internet Explorer or MSHTML displays modal UI.
virtual HRESULT OnEnableModeless(BOOL fEnable);
fEnable
Indicates if the host's modeless dialog boxes are enabled or disabled. If this value is nonzero, modeless dialog boxes are enabled. If this value is zero, modeless dialog boxes are disabled.
S_OK
if successful, or an OLE-defined error code otherwise.
Enables or disables modeless dialog boxes when the container creates or destroys a modal dialog box. Override OnEnableModeless
to react to the EnableModeless
notification from the Microsoft Web Browser control. See IDocHostUIHandler::EnableModeless
in the Windows SDK for more information.
Called on the host by Internet Explorer or MSHTML to allow the host to replace Internet Explorer or MSHTML's data object.
virtual HRESULT OnFilterDataObject(
LPDATAOBJECT pDataObject,
LPDATAOBJECT* ppDataObject);
pDataObject
Address of the IDataObject
interface supplied by Internet Explorer or MSHTML.
ppDataObject
Address that receives the IDataObject
interface pointer supplied by the host. The contents of this parameter should always be initialized to NULL
, even if the method fails.
S_OK
if the data object is replaced, S_FALSE
if the data object isn't replaced, or an OLE-defined error code if an error occurs.
Override OnFilterDataObject
to react to the FilterDataObject
notification from the Microsoft Web Browser control. See IDocHostUIHandler::FilterDataObject
in the Windows SDK for more information.
Called from IOleInPlaceActiveObject::OnFrameWindowActivate
to notify the object when the container's top-level frame window is activated or deactivated.
virtual HRESULT OnFrameWindowActivate(BOOL fActivate);
fActivate
Indicates the state of the container's top-level frame window. If this value is nonzero, the window is being activated. If this value is zero, the window is being deactivated.
S_OK
if successful, or an OLE-defined error code otherwise.
Override OnFrameWindowActivate
to react to the OnFrameWindowActivate
notification from the Microsoft Web Browser control. See IDocHostUIHandler::OnFrameWindowActivate
in the Windows SDK for more information.
This member function is called by the framework when the FullScreen
property has changed.
virtual void OnFullScreen(BOOL bFullScreen);
bFullScreen
Nonzero if Internet Explorer is in full screen mode; zero otherwise.
Called by Internet Explorer or MSHTML when it's being used as a drop target to allow the host to supply an alternative IDropTarget
.
virtual HRESULT OnGetDropTarget(
LPDROPTARGET pDropTarget,
LPDROPTARGET* ppDropTarget);
pDropTarget
IDropTarget
Internet Explorer or MSHTML proposes to use.
ppDropTarget
Address of the IDropTarget
that receives the IDropTarget
interface pointer the host wants to provide.
See IDocHostUIHandler::GetDropTarget
in the Windows SDK for a list of return codes.
Override OnGetDropTarget
to react to the GetDropTarget
notification from the Microsoft Web Browser control. See IDocHostUIHandler::GetDropTarget
in the Windows SDK for more information.
Called by Internet Explorer or MSHTML to obtain the host's IDispatch
interface.
virtual HRESULT OnGetExternal(LPDISPATCH* lppDispatch);
lppDispatch
A pointer to the address that receives the IDispatch
interface pointer of the host application. If the host exposes an Automation interface, it can provide a reference to Internet Explorer or MSHTML through this parameter. The contents of this parameter should always be initialized to NULL
, even if the method fails.
S_OK
if successful, or an OLE-defined error code otherwise.
Override OnGetExternal
to react to the GetExternal
notification from the Microsoft Web Browser control. See IDocHostUIHandler::GetExternal
in the Windows SDK for more information.
Retrieves the UI capabilities of the Internet Explorer or MSHTML host.
virtual HRESULT OnGetHostInfo(DOCHOSTUIINFO* pInfo);
pInfo
Address of a DOCHOSTUIINFO
structure that receives the host's UI capabilities.
S_OK
if successful, or an OLE-defined error code otherwise.
Override OnGetHostInfo
to react to the GetHostInfo
notification from the Microsoft Web Browser control. See IDocHostUIHandler::GetHostInfo
in the Windows SDK for more information.
Call this member function to get the registry key under which Internet Explorer or MSHTML stores user preferences.
virtual HRESULT OnGetOptionKeyPath(
LPOLESTR* pchKey,
DWORD dwReserved);
pchKey
Address of an LPOLESTR
that receives the registry subkey string where the host stores its default options. This subkey will be under the HKEY_CURRENT_USER
key. Allocate this memory using CoTaskMemAlloc
. The calling application is responsible for freeing this memory using CoTaskMemFree
. This parameter should always be initialized to NULL
, even if the method fails.
dwReserved
Reserved for future use. Not currently used.
S_OK
if successful, or S_FALSE
otherwise. If S_FALSE
, Internet Explorer or MSHTML will default to its own user options.
Override OnGetOptionKeyPath
to react to the GetOptionKeyPath
notification from the Microsoft Web Browser control. See IDocHostUIHandler::GetOptionKeyPath
in the Windows SDK for more information.
This member function is called by the framework when Internet Explorer or MSHTML removes its menus and toolbars.
virtual HRESULT OnHideUI();
S_OK
if successful, or an OLE-defined error code otherwise.
Override OnHideUI
to react to the HideUI
notification from the Microsoft Web Browser control. See IDocHostUIHandler::HideUI
in the Windows SDK for more information.
This member function is called by the framework when the MenuBar
property has changed.
virtual void OnMenuBar(BOOL bMenuBar);
bMenuBar
Nonzero if the Internet Explorer menu bar is visible; zero otherwise.
This member function is called by the framework after navigation to a hyperlink completes (on either a window or frameset element).
virtual void OnNavigateComplete2(LPCTSTR strURL);
strURL
A string expression that evaluates to the URL, UNC file name, or PIDL (a pointer to an item identifier list) that was navigated to.
The URL parameter can be a PIDL if there's a shell name space entity for which there's no URL representation.
The URL contained in strURL
can be different from the URL that the browser was told to navigate to, because this URL is the canonicalized and qualified URL. For example, if an application specifies a URL of "www.microsoft.com"
in a call to Navigate
or Navigate2
, the URL passed by OnNavigateComplete2
will be "<https://www.microsoft.com/>"
. Also, if the server has redirected the browser to a different URL, the redirected URL will be reflected here.
Called by the framework if navigation to a hyperlink fails.
virtual void OnNavigateError(
LPCTSTR lpszURL,
LPCTSTR lpszFrame,
DWORD dwError,
BOOL* pbCancel);
lpszURL
The URL for which navigation failed.
lpszFrame
The name of the frame in which the resource is to be displayed, or NULL
if no named frame was targeted for the resource.
dwError
An error status code, if available. For a list of the possible HRESULT
and HTTP status codes, see NavigateError
Event Status Codes..
pbCancel
Specifies whether to cancel the navigation to an error page or any further autosearch. If TRUE
(the default), continue with navigation to an error page or autosearch; if FALSE
, cancel navigation to an error page or autosearch.
Override this method to provide custom navigation error handling.
For more information, see DWebBrowserEvents2::NavigateError
This member function is called by the framework when a new window is to be created for displaying a resource.
virtual void OnNewWindow2(
LPDISPATCH* ppDisp,
BOOL* Cancel);
ppDisp
A pointer to an interface pointer that, optionally, receives the IDispatch
interface pointer of a new WebBrowser or Internet Explorer object.
Cancel
A pointer to a cancel flag. An application can set this parameter to nonzero to cancel the navigation operation, or to zero to allow it to continue.
This event precedes the creation of a new window from within the WebBrowser.
This member function is called by the framework to notify an application that the progress of a download operation has been updated.
virtual void OnProgressChange(
long nProgress,
long nProgressMax);
nProgress
Amount of total progress to show, or -1 when progress is complete.
nProgressMax
Maximum progress value.
The container can use the information provided by this event to display the number of bytes downloaded so far or to update a progress indicator.
This member function is called by the framework to notify an application that PutProperty
has changed the value of a property.
virtual void OnPropertyChange(LPCTSTR lpszProperty);
lpszProperty
A pointer to a string containing the name of the property.
This member function is called by the framework to notify an application that the Internet Explorer application is ready to quit.
virtual void OnQuit();
Called from the Internet Explorer or MSHTML implementation of IOleInPlaceActiveObject::ResizeBorder
, which alerts the object that it needs to resize its border space.
virtual HRESULT OnResizeBorder(
LPCRECT prcBorder,
LPOLEINPLACEUIWINDOW pUIWindow,
BOOL fFrameWindow);
prcBorder
New outer rectangle for border space.
pUIWindow
A pointer to the interface for the frame or document window object whose border has changed.
fFrameWindow
TRUE
if the frame window is calling IOleInPlaceActiveObject::ResizeBorder
, otherwise FALSE
.
S_OK
if successful, or an OLE-defined error code otherwise.
Override OnResizeBorder
to react to the ResizeBorder
notification from the Microsoft Web Browser control. See IDocHostUIHandler::ResizeBorder
in the Windows SDK for more information.
Called from Internet Explorer or MSHTML when it's about to show its context menu.
virtual HRESULT OnShowContextMenu(
DWORD dwID,
LPPOINT ppt,
LPUNKNOWN pcmdtReserved,
LPDISPATCH pdispReserved);
dwID
Identifier of the context menu to be displayed. See IDocHostUIHandler::ShowContextMenu
in the Windows SDK for a list of values.
ppt
Screen coordinates for the menu.
pcmdtReserved
IOleCommandTarget
interface used to query command status and execute commands on this object.
pdispReserved
IDispatch
interface of the object at the screen coordinates. This allows a host to differentiate particular objects to provide more specific context.
See IDocHostUIHandler::ShowContextMenu
in the Windows SDK for a list of values.
Override OnShowContextMenu
to react to the ShowContextMenu
notification from the Microsoft Web Browser control. See IDocHostUIHandler::ShowContextMenu
in the Windows SDK for more information.
Called before Internet Explorer or MSHTML displays its menus and toolbars.
virtual HRESULT OnShowUI(
DWORD dwID,
LPOLEINPLACEACTIVEOBJECT pActiveObject,
LPOLECOMMANDTARGET pCommandTarget,
LPOLEINPLACEFRAME pFrame,
LPOLEINPLACEUIWINDOW pDoc);
dwID
Reserved for future use.
pActiveObject
IOleInPlaceActiveObject
interface of the currently active object.
pCommandTarget
IOleCommandTarget
interface of the object.
pFrame
IOleInPlaceFrame
interface of the object. This is needed for menus and toolbars.
pDoc
IOleInPlaceUIWindow
interface for the object. This is needed for toolbars.
See IDocHostUIHandler::ShowUI
in the Windows SDK for a list of values.
Override OnShowUI
to react to the ShowUI
notification from the Microsoft Web Browser control. See IDocHostUIHandler::ShowUI
in the Windows SDK for more information.
This member function is called by the framework when the StatusBar
property has changed.
virtual void OnStatusBar(BOOL bStatusBar);
bStatusBar
Nonzero if Internet Explorer's status bar is visible or zero otherwise.
This member function is called by the framework to notify an application that the text of the status bar associated with the WebBrowser control has changed.
virtual void OnStatusTextChange(LPCTSTR lpszText);
lpszText
A string that contains the new status bar text.
This member function is called by the framework when the TheaterMode
property has changed.
virtual void OnTheaterMode(BOOL bTheaterMode);
bTheaterMode
Nonzero if Internet Explorer is in theater mode; zero otherwise.
This member function is called by the framework to notify an application if the title of a document in the WebBrowser control becomes available or changes.
virtual void OnTitleChange(LPCTSTR lpszText);
lpszText
The new document title.
For HTML, the title might change; while HTML is still downloading, the URL of the document is set as the title. After the real title (if there is one) is parsed from the HTML, the title is changed to reflect the actual title.
This member function is called by the framework when the ToolBar
property has changed.
virtual void OnToolBar(BOOL bToolBar);
bToolBar
Nonzero if Internet Explorer's toolbar is visible or zero otherwise.
Called by Internet Explorer or MSHTML when IOleInPlaceActiveObject::TranslateAccelerator
or IOleControlSite::TranslateAccelerator
is called to process menu accelerator-key messages from the container's message queue.
virtual HRESULT OnTranslateAccelerator(
LPMSG lpMsg,
const GUID* pguidCmdGroup,
DWORD nCmdID);
lpMsg
Points to the message that might need to be translated.
pguidCmdGroup
Command group identifier.
nCmdID
Command identifier.
S_OK
if successful, or S_FALSE
otherwise.
Override OnTranslateAccelerator
to react to the TranslateAccelerator
notification from the Microsoft Web Browser control. See IDocHostUIHandler::TranslateAccelerator
in the Windows SDK for more information.
Called by Internet Explorer or MSHTML to allow the host an opportunity to modify the URL to be loaded.
virtual HRESULT OnTranslateUrl(
DWORD dwTranslate,
OLECHAR* pchURLIn,
OLECHAR** ppchURLOut);
dwTranslate
Reserved for future use.
pchURLIn
Address of a string supplied by Internet Explorer or MSHTML that represents the URL to be translated.
ppchURLOut
Address of a string pointer that receives the address of the translated URL. The host allocates the buffer using the task memory allocator. The contents of this parameter should always be initialized to NULL
, even if the URL isn't translated or the method fails.
S_OK
if the URL was translated, S_FALSE
if the URL wasn't translated, or an OLE-defined error code if an error occurred.
Override OnTranslateUrl
to react to the TranslateUrl
notification from the Microsoft Web Browser control. See IDocHostUIHandler::TranslateUrl
in the Windows SDK for more information.
Notifies the host that the command state has changed.
virtual HRESULT OnUpdateUI();
S_OK
if successful, or an OLE-defined error code otherwise.
The host should update the state of toolbar buttons. This method is called regardless of the return value from ShowUI
. Override OnUpdateUI
to react to the UpdateUI
notification from the Microsoft Web Browser control.
This member function is called by the framework when the window for the WebBrowser should be shown or hidden.
virtual void OnVisible(BOOL bVisible);
bVisible
Nonzero if the object is visible or zero otherwise.
This allows the object control host window to behave the same way the Internet Explorer window would behave.
Call this member function to set the property associated with a given object.
void PutProperty(
LPCTSTR lpszProperty,
const VARIANT& vtValue);
void PutProperty(
LPCTSTR lpszPropertyName,
double dValue);
void PutProperty(
LPCTSTR lpszPropertyName,
long lValue);
void PutProperty(
LPCTSTR lpszPropertyName,
LPCTSTR lpszValue);
void PutProperty(
LPCTSTR lpszPropertyName,
short nValue);
lpszProperty
A string containing the property to set.
vtValue
The new value of the property indicated by lpszProperty
.
lpszPropertyName
A pointer to a string containing the name of the property to set.
dValue
The new value of the property.
lValue
The new value of the property.
lpszValue
A pointer to a string containing the new value of the property.
nValue
The new value of the property.
Applies to Internet Explorer and WebBrowser.
Queries for the status of one or more commands generated by user interface events.
HRESULT QueryFormsCommand(
DWORD dwCommandID,
BOOL* pbSupported,
BOOL* pbEnabled,
BOOL* pbChecked);
dwCommandID
The identifier of the command being queried for.
pbSupported
A pointer to a BOOL
specifying if the command (identified by dwCommandID
) is supported. If TRUE
, the command is supported; otherwise FALSE
.
pbEnabled
A pointer to a BOOL
specifying if the command (identified by dwCommandID
) is enabled. If TRUE
, the command is supported; otherwise FALSE
.
pbChecked
A pointer to a BOOL
specifying if the command (identified by dwCommandID
) is checked. If TRUE
, the command is supported; otherwise FALSE
.
A standard HRESULT
value. For a complete listing of possible values, see IOleCommandTarget::QueryStatus
in the Windows SDK.
QueryFormsCommand
implements the behavior of the IOleCommandTarget::QueryStatus
method.
Call this member function to query a command status.
OLECMDF QueryStatusWB(OLECMDID cmdID) const;
cmdID
The OLECMDID
value of the command for which the caller needs status information.
The address of the OLECMDF
value that receives the status of the command.
QueryStatusWB
implements the behavior of the IOleCommandTarget::QueryStatus
method.
Applies to Internet Explorer and WebBrowser.
Reloads the URL or file that the web browser is currently displaying.
void Refresh();
Refresh
contains no parameters for setting the refresh level.
Applies to Internet Explorer and WebBrowser.
Reloads the file that Internet Explorer is currently displaying.
void Refresh2(int nLevel);
nLevel
The address of the variable specifying the refresh level. The possible variables are defined in RefreshConstants
, in the Windows SDK.
Unlike Refresh
, Refresh2
contains a parameter that specifies the refresh level.
Applies to Internet Explorer and WebBrowser.
Call this member function to show or hide the Internet Explorer object's address bar.
void SetAddressBar(BOOL bNewValue);
bNewValue
Nonzero to show address bar; otherwise zero.
Applies to Internet Explorer. If you use this call with a WebBrowser control, it will return no error, but it will ignore this call.
Call this member function to set Internet Explorer to either full-screen or normal window mode.
void SetFullScreen(BOOL bNewValue);
bNewValue
Nonzero for full-screen mode; otherwise zero.
In full-screen mode, the Internet Explorer main window is maximized and the status bar, toolbar, menu bar, and title bar are hidden.
Applies to Internet Explorer. If you use this call with a WebBrowser control, it will return no error, but it will ignore this call.
Call this member function to set the height of the Internet Explorer main window.
void SetHeight(long nNewValue);
nNewValue
The height, in pixels, of the main window.
Applies to Internet Explorer and WebBrowser.
Sets the horizontal position of the Internet Explorer main window.
void SetLeft(long nNewValue);
nNewValue
The screen coordinate of the left edge of the main window.
Call this member function to show or hide the Internet Explorer menu bar.
void SetMenuBar(BOOL bNewValue);
bNewValue
Nonzero to show menu bar; otherwise zero.
Applies to Internet Explorer. If you use this call with a WebBrowser control, it will return no error, but it will ignore this call.
Call this member function to set a value indicating whether the WebBrowser control is currently operating in offline mode.
void SetOffline(BOOL bNewValue);
bNewValue
Nonzero to read from the local cache; otherwise zero.
In offline mode, the browser reads HTML pages from the local cache rather than from the source document.
Applies to Internet Explorer and WebBrowser.
Call this member function to set a value indicating whether the WebBrowser control is registered as a top-level browser for target name resolution.
void SetRegisterAsBrowser(BOOL bNewValue);
bNewValue
Determines whether Internet Explorer is registered as a top-level browser. If nonzero, the web browser is registered as a top-level browser; if zero, it's not a top-level browser. The default value is zero.
A top-level browser is the browser set in the registry as the default browser.
Applies to Internet Explorer and WebBrowser.
Call this member function to set a value indicating whether the WebBrowser control is registered as a drop target for navigation.
void SetRegisterAsDropTarget(BOOL bNewValue);
bNewValue
Determines if the WebBrowser control is registered as a drop target for navigation. If nonzero, the object is registered as a drop target; if zero, it's not a drop target.
Applies to Internet Explorer and WebBrowser.
Call this member function to set a value indicating whether any dialog boxes can be shown.
void SetSilent(BOOL bNewValue);
bNewValue
If nonzero, dialog boxes won't be displayed; if zero, dialog boxes will be displayed. The default value is zero.
Applies to Internet Explorer and WebBrowser.
Call this member function to display the status bar.
void SetStatusBar(BOOL bNewValue);
bNewValue
Nonzero if the status bar is visible; otherwise zero.
Applies to Internet Explorer. If you use this call with a WebBrowser control, it will return no error, but it will ignore this call.
Call this member function to set a value indicating whether the WebBrowser control is in theater mode.
void SetTheaterMode(BOOL bNewValue);
bNewValue
Nonzero to set the WebBrowser control to theater mode; otherwise zero. The default value is zero.
When the web browser is in theater mode, the browser main window fills the entire screen, a toolbar with a minimal set of navigational tools appears, and the status bar appears in the upper right-hand corner of the screen.
Applies to Internet Explorer and WebBrowser.
Call this member function to show or hide the Internet Explorer toolbar.
void SetToolBar(int nNewValue);
nNewValue
Indicates whether to display the toolbar. Nonzero if the toolbar is to be displayed; otherwise zero.
Applies to Internet Explorer. If you use this call with a WebBrowser control, it will return no error, but it will ignore this call.
Call this member function to set the distance between the internal top edge of the WebBrowser control and the top edge of its container
void SetTop(long nNewValue);
nNewValue
The screen coordinate of the top edge of the main window.
Applies to Internet Explorer and WebBrowser.
Call this member function to set the visibility state of the WebBrowser control.
void SetVisible(BOOL bNewValue);
bNewValue
Nonzero if the control is visible; otherwise zero.
Applies to Internet Explorer and WebBrowser.
Sets the width of the Internet Explorer main window.
void SetWidth(long nNewValue);
nNewValue
The width, in pixels, of the Internet Explorer main window.
Call this member function to cancel any pending navigation or download operation and stop any dynamic page elements, such as background sounds and animations.
void Stop();
Applies to Internet Explorer and WebBrowser.
MFC Sample MFCIE
CFormView
class
Hierarchy chart
IWebBrowser2