IWebBrowser2::TopLevelContainer Property

Gets a value that indicates whether the object is a top-level container.


HRESULT IWebBrowser2::get_TopLevelContainer(VARIANT_BOOL *pBool);


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

Possible Values

VARIANT_FALSE Object is not a top-level container.
VARIANT_TRUE Object is a top-level container.

Return Value

Returns S_OK to indicate that the operation was successful.


The WebBrowser object returns VARIANT_FALSE if it is in a frame; InternetExplorer always returns VARIANT_TRUE.