CWebBrowser Class |
Description
This class provides a web browser in a window. It can be used to provide a web browser in any place a view window is used.
CWebBrowser Members
Construction |
CWebBrowser();Constructs a CWebBrowser object. Attributes GetApplication
LPDISPATCH GetApplication() const;Retrieves the automation object for the application that is hosting the WebBrowser Control. GetAXWindow
CAXWindow& GetAXWindow() const;Returns a reference to the ActiveX container window. GetBusy
BOOL GetBusy() const;Retrieves a value that indicates whether the object is engaged in a navigation or downloading operation. GetContainer
LPDISPATCH GetContainer() const;Retrieves an object reference to a container. GetFullScreen
BOOL GetFullScreen() const;Retrieves a value that indicates whether Internet Explorer is in full-screen mode or normal window mode. GetHeight
long GetHeight() const;Retrieves the height of the object. GetIWebBrowser2
IWebBrowser2* GetIWebBrowser2();Returns the pointer to the IWebBrowser interface. GetLeft
long GetLeft() const;Retrieves the coordinate of the left edge of the object. GetLocateName
CString GetLocationName() const;Retrieves the path or title of the resource that is currently displayed. GetLocationURL
CString GetLocationURL() const;Retrieves the URL of the resource that is currently displayed. GetOffline
BOOL GetOffline() const;Retrieves a value that indicates whether the object is operating in offline mode. GetReadyState
READYSTATE GetReadyState() const;Retrieves the ready state of the object. GetRegisterAsBrowser
BOOL GetRegisterAsBrowser() const;Retrieves a value that indicates whether the object is registered as a top-level browser window. GetTheaterMode
BOOL GetTheaterMode() const;Retrieves the theater mode state of the object. GetTop
long GetTop() const;Retrieves the coordinate of the top edge of the object. GetTopLevelContainer
BOOL GetTopLevelContainer() const;Retrieves a value that indicates whether the object is a top-level container. GetType
CString GetType() const;Retrieves the user type name of the contained document object. GetVisible
BOOL GetVisible() const;Retrieves a value that indicates whether the object is visible or hidden. GetWidth
long GetWidth() const;Retrieves the width of the object. SetFullScreen
void SetFullScreen(BOOL bNewValue);Sets a value that indicates whether Internet Explorer is in full-screen mode or normal window mode. SetHeight
void SetHeight(long nNewValue);Sets the height of the object. SetLeft
void SetLeft(long nNewValue);Sets the coordinate of the left edge of the object.e. SetOffline
void SetOffline(BOOL bNewValue);Sets a value that indicates whether the object is operating in offline mode. SetRegisterAsBrowser
void SetRegisterAsBrowser(BOOL bNewValue);Sets a value that indicates whether the object is registered as a top-level browser window. SetTheaterMode
void SetTheaterMode(BOOL bNewValue);Sets the theatre mode state of the object. SetTop
void SetTop(long nNewValue);Sets the coordinate of the top edge of the object. SetVisible
void SetVisible(BOOL bNewValue);Sets a value that indicates whether the object is visible or hidden. SetWidth
void SetWidth(long nNewValue);Sets the width of the object. Operations AddWebBrowserControl
void AddWebBrowserControl(void);Adds the IWebBrowser interface to the ActiveX container window. Exec
void ExecWB(OLECMDID cmdID, OLECMDEXECOPT cmdexecopt, VARIANT* pvaIn, VARIANT* pvaOut);Executes a command using the IOleCommandTarget interface. GetProperty
BOOL GetProperty(LPCTSTR pszProperty, CString& strValue);
VARIANT GetProperty( LPCTSTR pszProperty);Gets the value associated with the specified property name. GoBack
void GoBack();Navigates backward one item in the history list. GoForward
void GoForward();Navigates forward one item in the history list. GoHome
void GoHome();Navigates to the current home or start page. GoSearch
void GoSearch();Navigates to the current search page. Navigate
void Navigate(LPCTSTR pszURL, DWORD dwFlags = 0, LPCTSTR pszTargetFrameName = NULL, LPCTSTR pszHeaders = NULL, LPVOID pvPostData = NULL, DWORD dwPostDataLen = 0);Navigates to a resource identified by a URL or to a file identified by a full path. Navigate2
void Navigate2(LPITEMIDLIST pIDL, DWORD dwFlags = 0, LPCTSTR pszTargetFrameName = NULL);
void Navigate2(LPCTSTR pszURL, DWORD dwFlags = 0, LPCTSTR pszTargetFrameName = NULL, LPCTSTR pszHeaders = NULL, LPVOID lpvPostData = NULL, DWORD dwPostDataLen = 0);Navigates the browser to a location specified by a pointer to an item identifier list (PIDL) for an entity in the Microsoft Windows Shell namespace, or a URL. PutProperty
void PutProperty(LPCTSTR pszPropertyName, const VARIANT& vtValue);
void PutProperty(LPCTSTR pszPropertyName, double dValue);
void PutProperty(LPCTSTR pszPropertyName, long lValue);
void PutProperty(LPCTSTR pszPropertyName, LPCTSTR lpszValue);
void PutProperty(LPCTSTR pszPropertyName, short nValue);Sets the value of a property associated with the object. Refresh
void Refresh();Reloads the file that is currently displayed in the object. Refresh2
void Refresh2(int nLevel);Reloads the file that is currently displayed with the specified refresh level. Stop
void Stop();Cancels a pending navigation or download, and stops dynamic page elements, such as background sounds and animations. Overridables OnCreate
virtual void OnCreate();Called when the window is created. OnSize
virtual void OnSize(int width, int height);Called when the window is resized.
Base class Members
For base class members, refer to the members of CWnd.
Remarks
Refer to the Browser sample for a demonstration of how to use CWebBrowser to implement a simple web browser.
Summary Information
Header file | webbrowser.h |
Win32/64 support | Yes |
WinCE support | No |
Library required |