From: Steve Lamerton Date: Sat, 2 Jul 2011 16:41:51 +0000 (+0000) Subject: Get the page title from the IHtmlDocument rather than the bowser as it actually retur... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/977c53206a4be411999140b514507e161e1f0a04 Get the page title from the IHtmlDocument rather than the bowser as it actually returns the title rather than the url. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68137 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/webview_ie.cpp b/src/msw/webview_ie.cpp index c3b53be9d8..398b4af75c 100644 --- a/src/msw/webview_ie.cpp +++ b/src/msw/webview_ie.cpp @@ -504,10 +504,15 @@ wxString wxWebViewIE::GetCurrentURL() wxString wxWebViewIE::GetCurrentTitle() { - wxVariant out = m_ie.GetProperty("LocationName"); + wxVariant documentVariant = m_ie.GetProperty("Document"); + void* documentPtr = documentVariant.GetVoidPtr(); + IHTMLDocument2* document = (IHTMLDocument2*)documentPtr; - wxASSERT(out.GetType() == "string"); - return out.GetString(); + wxASSERT(documentPtr && document); + + BSTR title; + document->get_nameProp(&title); + return wxString(title); } bool wxWebViewIE::CanCut()