IWebBrowser2::RegisterAsBrowser Property

Sets or gets a value that indicates whether the object is registered as a top-level browser window.


HRESULT IWebBrowser2::get_RegisterAsBrowser(VARIANT_BOOL *pbRegister);
HRESULT IWebBrowser2::put_RegisterAsBrowser(VARIANT_BOOL bRegister);


  • pbRegister
    Pointer to a variable of type VARIANT_BOOL that receives one of the values listed in Possible Values.
  • bRegister
    VARIANT_BOOL that specifies one of the values listed in Possible Values.

Possible Values

VARIANT_FALSE Default. Object is not registered as a top-level browser.
VARIANT_TRUE Object is registered as a top-level browser.

Return Value

Returns S_OK if successful, or an error value otherwise.


The architecture of Windows Internet Explorer allows for multiple instances of the IWebBrowser2 object. A "top-level" IWebBrowser2 object is the parent of all other IWebBrowser2 objects. Only top-level objects can register as a browser with this method.

By setting this property to VARIANT_TRUE, Internet Explorer and Windows can locate other top-level IWebBrowser2 objects that can participate in frame name resolution. For example, if the user clicks on a hyperlink that specifies a target attribute that is not in the current window, Internet Explorer searches all registered IWebBrowser2 objects in an attempt to resolve the target name.

After the window is registered as a top-level browser, it cannot be unregistered.