bgiGetHTMLTitle

Retrieves the title of the currently loaded HTML document. Takes htmlViewID (Int). Returns UTF-8 title string, or empty string "" if htmlViewID not found or title unavailable.

BGI GUI

Parameters & Returns

Parameters

htmlViewID Int

Returns

String

Quick Summary

Retrieves the title of the currently loaded HTML document. Takes htmlViewID (Int). Returns UTF-8 title string, or empty string "" if htmlViewID not found or title unavailable.

Technical Exegesis...

Retrieves the title of the currently loaded HTML document. Searches webBrowserMap for htmlViewID. If found, gets IWebBrowser2* interface. Calls get_LocationName(&bstrTitle) to retrieve document title BSTR. Converts BSTR to UTF-8 std::string using WideCharToMultiByte with CP_UTF8. SysFreeString releases BSTR. Returns UTF-8 title string, or empty string "" if htmlViewID not found or title unavailable.

This function returns the document's <title> element content.

Example

Example.bam
; No example implemented yet