CHtmlView Class

Provides the functionality of the WebBrowser control within the context of MFC's document/view architecture.

class CHtmlView : public CFormView

Members

Public Methods

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 [Automation].

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 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 is 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 a 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 is 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.

Remarks

The WebBrowser control is a window in which the user can browse sites on the World Wide Web, as well as 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.

Using the CHtmlView Class in an MFC Application

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 will have no visible effect.

Inheritance Hierarchy

CObject

CCmdTarget

CWnd

CView

CScrollView

CFormView

CHtmlView

Requirements

Header: afxhtml.h

See Also

Reference

CFormView Class

Hierarchy Chart

IWebBrowser2

Concepts

MFC Sample MFCIE