IWebBrowser2::LocationName Property

Retrieves the path or title of the resource that is currently displayed.

Syntax

HRESULT IWebBrowser2::get_LocationName(BSTR *pbstrLocationName);

Parameters

  • pbstrLocationName
    Pointer to a variable of type BSTR that receives the location name. The caller frees this buffer with SysFreeString.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

If the resource is an HTML webpage, the name is the title of the document. If the resource is a folder or file on the network or local computer, the name is the full file system path of the folder or file in Universal Naming Convention (UNC) format.

If this method is called before the first navigation is complete, InternetExplorer returns an empty string and S_FALSE .

See Also

IWebBrowser2::get_LocationURL, IWebBrowser2::get_Name