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.
LPDISPATCH GetApplication() const;Retrieves the automation object for the application that is hosting the WebBrowser Control.
CAXWindow& GetAXWindow() const;Returns a reference to the ActiveX container window.
BOOL GetBusy() const;Retrieves a value that indicates whether the object is engaged in a navigation or downloading operation.
LPDISPATCH GetContainer() const;Retrieves an object reference to a container.
BOOL GetFullScreen() const;Retrieves a value that indicates whether Internet Explorer is in full-screen mode or normal window mode.
long GetHeight() const;Retrieves the height of the object.
IWebBrowser2* GetIWebBrowser2();Returns the pointer to the IWebBrowser interface.
long GetLeft() const;Retrieves the coordinate of the left edge of the object.
CString GetLocationName() const;Retrieves the path or title of the resource that is currently displayed.
CString GetLocationURL() const;Retrieves the URL of the resource that is currently displayed.
BOOL GetOffline() const;Retrieves a value that indicates whether the object is operating in offline mode.
READYSTATE GetReadyState() const;Retrieves the ready state of the object.
BOOL GetRegisterAsBrowser() const;Retrieves a value that indicates whether the object is registered as a top-level browser window.
BOOL GetTheaterMode() const;Retrieves the theater mode state of the object.
long GetTop() const;Retrieves the coordinate of the top edge of the object.
BOOL GetTopLevelContainer() const;Retrieves a value that indicates whether the object is a top-level container.
CString GetType() const;Retrieves the user type name of the contained document object.
BOOL GetVisible() const;Retrieves a value that indicates whether the object is visible or hidden.
long GetWidth() const;Retrieves the width of the object.
void SetFullScreen(BOOL bNewValue);Sets a value that indicates whether Internet Explorer is in full-screen mode or normal window mode.
void SetHeight(long nNewValue);Sets the height of the object.
void SetLeft(long nNewValue);Sets the coordinate of the left edge of the object.e.
void SetOffline(BOOL bNewValue);Sets a value that indicates whether the object is operating in offline mode.
void SetRegisterAsBrowser(BOOL bNewValue);Sets a value that indicates whether the object is registered as a top-level browser window.
void SetTheaterMode(BOOL bNewValue);Sets the theatre mode state of the object.
void SetTop(long nNewValue);Sets the coordinate of the top edge of the object.
void SetVisible(BOOL bNewValue);Sets a value that indicates whether the object is visible or hidden.
void SetWidth(long nNewValue);Sets the width of the object.
void AddWebBrowserControl(void);Adds the IWebBrowser interface to the ActiveX container window.
void ExecWB(OLECMDID cmdID, OLECMDEXECOPT cmdexecopt, VARIANT* pvaIn, VARIANT* pvaOut);Executes a command using the IOleCommandTarget interface.
BOOL GetProperty(LPCTSTR pszProperty, CString& strValue);
VARIANT GetProperty( LPCTSTR pszProperty);Gets the value associated with the specified property name.
void GoBack();Navigates backward one item in the history list.
void GoForward();Navigates forward one item in the history list.
void GoHome();Navigates to the current home or start page.
void GoSearch();Navigates to the current search page.
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.
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.
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.
void Refresh();Reloads the file that is currently displayed in the object.
void Refresh2(int nLevel);Reloads the file that is currently displayed with the specified refresh level.
void Stop();Cancels a pending navigation or download, and stops dynamic page elements, such as background sounds and animations.
virtual void OnCreate();Called when the window is created.
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 |