1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/msw/webview_ie.cpp
3 // Purpose: wxMSW wxWebViewIE class implementation for web view component
4 // Author: Marianne Gagnon
6 // Copyright: (c) 2010 Marianne Gagnon, Steven Lamerton
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 // For compilers that support precompilation, includes "wx.h".
11 #include "wx/wxprec.h"
13 #if defined(__BORLANDC__)
17 #include "wx/msw/webview_ie.h"
27 // Various definitions are missing from mingw
29 typedef enum CommandStateChangeConstants
{
30 CSC_UPDATECOMMANDS
= (int) 0xFFFFFFFF,
31 CSC_NAVIGATEFORWARD
= 0x1,
32 CSC_NAVIGATEBACK
= 0x2
33 } CommandStateChangeConstants
;
35 #define DISPID_COMMANDSTATECHANGE 105
36 #define DISPID_NAVIGATECOMPLETE2 252
37 #define DISPID_NAVIGATEERROR 271
38 #define DISPID_NEWWINDOW3 273
39 #define OLECMDID_OPTICAL_ZOOM 63
40 #define INET_E_ERROR_FIRST 0x800C0002L
41 #define INET_E_INVALID_URL 0x800C0002L
42 #define INET_E_NO_SESSION 0x800C0003L
43 #define INET_E_CANNOT_CONNECT 0x800C0004L
44 #define INET_E_RESOURCE_NOT_FOUND 0x800C0005L
45 #define INET_E_OBJECT_NOT_FOUND 0x800C0006L
46 #define INET_E_DATA_NOT_AVAILABLE 0x800C0007L
47 #define INET_E_DOWNLOAD_FAILURE 0x800C0008L
48 #define INET_E_AUTHENTICATION_REQUIRED 0x800C0009L
49 #define INET_E_NO_VALID_MEDIA 0x800C000AL
50 #define INET_E_CONNECTION_TIMEOUT 0x800C000BL
51 #define INET_E_INVALID_REQUEST 0x800C000CL
52 #define INET_E_UNKNOWN_PROTOCOL 0x800C000DL
53 #define INET_E_SECURITY_PROBLEM 0x800C000EL
54 #define INET_E_CANNOT_LOAD_DATA 0x800C000FL
55 #define INET_E_CANNOT_INSTANTIATE_OBJECT 0x800C0010L
56 #define INET_E_QUERYOPTION_UNKNOWN 0x800C0013L
57 #define INET_E_REDIRECT_FAILED 0x800C0014L
58 #define INET_E_REDIRECT_TO_DIR 0x800C0015L
59 #define INET_E_CANNOT_LOCK_REQUEST 0x800C0016L
60 #define INET_E_USE_EXTEND_BINDING 0x800C0017L
61 #define INET_E_TERMINATED_BIND 0x800C0018L
62 #define INET_E_INVALID_CERTIFICATE 0x800C0019L
63 #define INET_E_CODE_DOWNLOAD_DECLINED 0x800C0100L
64 #define INET_E_RESULT_DISPATCHED 0x800C0200L
65 #define INET_E_CANNOT_REPLACE_SFP_FILE 0x800C0300L
66 #define INET_E_CODE_INSTALL_BLOCKED_BY_HASH_POLICY 0x800C0500L
67 #define INET_E_CODE_INSTALL_SUPPRESSED 0x800C0400L
69 #define REFRESH_NORMAL 0
70 #define REFRESH_COMPLETELY 3
73 BEGIN_EVENT_TABLE(wxWebViewIE
, wxControl
)
74 EVT_ACTIVEX(wxID_ANY
, wxWebViewIE::onActiveXEvent
)
75 EVT_ERASE_BACKGROUND(wxWebViewIE::onEraseBg
)
78 bool wxWebViewIE::Create(wxWindow
* parent
,
86 if (!wxControl::Create(parent
, id
, pos
, size
, style
,
87 wxDefaultValidator
, name
))
93 m_canNavigateBack
= false;
94 m_canNavigateForward
= false;
96 m_historyLoadingFromList
= false;
97 m_historyEnabled
= true;
98 m_historyPosition
= -1;
100 if (::CoCreateInstance(CLSID_WebBrowser
, NULL
,
101 CLSCTX_INPROC_SERVER
, // CLSCTX_INPROC,
102 IID_IWebBrowser2
, (void**)&m_webBrowser
) != 0)
104 wxLogError("Failed to initialize IE, CoCreateInstance returned an error");
108 m_ie
.SetDispatchPtr(m_webBrowser
); // wxAutomationObject will release itself
110 m_webBrowser
->put_RegisterAsBrowser(VARIANT_TRUE
);
111 m_webBrowser
->put_RegisterAsDropTarget(VARIANT_TRUE
);
112 //m_webBrowser->put_Silent(VARIANT_FALSE);
114 m_container
= new wxActiveXContainer(this, IID_IWebBrowser2
, m_webBrowser
);
116 SetBackgroundStyle(wxBG_STYLE_PAINT
);
117 SetDoubleBuffered(true);
123 void wxWebViewIE::LoadUrl(const wxString
& url
)
125 wxVariant out
= m_ie
.CallMethod("Navigate", (BSTR
) url
.wc_str(),
126 NULL
, NULL
, NULL
, NULL
);
128 // FIXME: why is out value null??
129 //(HRESULT)(out.GetLong()) == S_OK;
132 void wxWebViewIE::SetPage(const wxString
& html
, const wxString
& baseUrl
)
134 LoadUrl("about:blank");
136 // Let the wx events generated for navigation events be processed, so
137 // that the underlying IE component completes its Document object.
138 // FIXME: calling wxYield is not elegant nor very reliable probably
141 wxVariant documentVariant
= m_ie
.GetProperty("Document");
142 void* documentPtr
= documentVariant
.GetVoidPtr();
144 wxASSERT (documentPtr
!= NULL
);
146 // TODO: consider the "baseUrl" parameter if possible
147 // TODO: consider encoding
148 BSTR bstr
= SysAllocString(html
.wc_str());
150 // Creates a new one-dimensional array
151 SAFEARRAY
*psaStrings
= SafeArrayCreateVector(VT_VARIANT
, 0, 1);
152 if (psaStrings
!= NULL
)
155 HRESULT hr
= SafeArrayAccessData(psaStrings
, (LPVOID
*)¶m
);
157 param
->bstrVal
= bstr
;
159 hr
= SafeArrayUnaccessData(psaStrings
);
161 IHTMLDocument2
* document
= (IHTMLDocument2
*)documentPtr
;
162 document
->write(psaStrings
);
164 // SafeArrayDestroy calls SysFreeString for each BSTR
165 SafeArrayDestroy(psaStrings
);
169 wxLogError("wxWebViewIE::SetPage() : psaStrings is NULL");
174 wxString
wxWebViewIE::GetPageSource()
176 wxVariant documentVariant
= m_ie
.GetProperty("Document");
177 void* documentPtr
= documentVariant
.GetVoidPtr();
179 if (documentPtr
== NULL
)
181 return wxEmptyString
;
184 IHTMLDocument2
* document
= (IHTMLDocument2
*)documentPtr
;
186 IHTMLElement
*bodyTag
= NULL
;
187 IHTMLElement
*htmlTag
= NULL
;
188 document
->get_body(&bodyTag
);
189 wxASSERT(bodyTag
!= NULL
);
192 bodyTag
->get_parentElement(&htmlTag
);
193 wxASSERT(htmlTag
!= NULL
);
196 htmlTag
->get_outerHTML(&bstr
);
201 //wxMessageBox(wxString(bstr));
203 // TODO: check encoding
204 return wxString(bstr
);
207 // FIXME? retrieve OLECMDID_GETZOOMRANGE instead of hardcoding range 0-4
208 wxWebViewZoom
wxWebViewIE::GetZoom()
210 const int zoom
= GetIETextZoom();
215 return wxWEB_VIEW_ZOOM_TINY
;
218 return wxWEB_VIEW_ZOOM_SMALL
;
221 return wxWEB_VIEW_ZOOM_MEDIUM
;
224 return wxWEB_VIEW_ZOOM_LARGE
;
227 return wxWEB_VIEW_ZOOM_LARGEST
;
231 return wxWEB_VIEW_ZOOM_MEDIUM
;
234 void wxWebViewIE::SetZoom(wxWebViewZoom zoom
)
236 // I know I could cast from enum to int since wxWebViewZoom happens to
237 // match with IE's zoom levels, but I don't like doing that, what if enum
241 case wxWEB_VIEW_ZOOM_TINY
:
244 case wxWEB_VIEW_ZOOM_SMALL
:
247 case wxWEB_VIEW_ZOOM_MEDIUM
:
250 case wxWEB_VIEW_ZOOM_LARGE
:
253 case wxWEB_VIEW_ZOOM_LARGEST
:
261 void wxWebViewIE::SetIETextZoom(int level
)
264 VariantInit (&zoomVariant
);
265 V_VT(&zoomVariant
) = VT_I4
;
266 V_I4(&zoomVariant
) = level
;
268 HRESULT result
= m_webBrowser
->ExecWB(OLECMDID_ZOOM
,
269 OLECMDEXECOPT_DONTPROMPTUSER
,
271 wxASSERT (result
== S_OK
);
273 VariantClear (&zoomVariant
);
276 int wxWebViewIE::GetIETextZoom()
279 VariantInit (&zoomVariant
);
280 V_VT(&zoomVariant
) = VT_I4
;
281 V_I4(&zoomVariant
) = 4;
283 HRESULT result
= m_webBrowser
->ExecWB(OLECMDID_ZOOM
,
284 OLECMDEXECOPT_DONTPROMPTUSER
,
286 wxASSERT (result
== S_OK
);
288 int zoom
= V_I4(&zoomVariant
);
289 // wxMessageBox(wxString::Format("Zoom : %i", zoom));
290 VariantClear (&zoomVariant
);
295 void wxWebViewIE::SetIEOpticalZoom(float zoom
)
297 // TODO: add support for optical zoom (IE7+ only)
299 // TODO: get range from OLECMDID_OPTICAL_GETZOOMRANGE instead of hardcoding?
300 wxASSERT(zoom
>= 10.0f
);
301 wxASSERT(zoom
<= 1000.0f
);
304 VariantInit (&zoomVariant
);
305 V_VT(&zoomVariant
) = VT_I4
;
306 V_I4(&zoomVariant
) = (zoom
* 100.0f
);
308 HRESULT result
= m_webBrowser
->ExecWB((OLECMDID
)OLECMDID_OPTICAL_ZOOM
,
309 OLECMDEXECOPT_DODEFAULT
,
312 wxASSERT (result
== S_OK
);
315 float wxWebViewIE::GetIEOpticalZoom()
317 // TODO: add support for optical zoom (IE7+ only)
320 VariantInit (&zoomVariant
);
321 V_VT(&zoomVariant
) = VT_I4
;
322 V_I4(&zoomVariant
) = -1;
324 HRESULT result
= m_webBrowser
->ExecWB((OLECMDID
)OLECMDID_OPTICAL_ZOOM
,
325 OLECMDEXECOPT_DODEFAULT
, NULL
,
327 wxASSERT (result
== S_OK
);
329 const int zoom
= V_I4(&zoomVariant
);
330 VariantClear (&zoomVariant
);
332 return zoom
/ 100.0f
;
335 void wxWebViewIE::SetZoomType(wxWebViewZoomType
)
337 // TODO: add support for optical zoom (IE7+ only)
341 wxWebViewZoomType
wxWebViewIE::GetZoomType() const
343 // TODO: add support for optical zoom (IE7+ only)
344 return wxWEB_VIEW_ZOOM_TYPE_TEXT
;
347 bool wxWebViewIE::CanSetZoomType(wxWebViewZoomType
) const
349 // both are supported
350 // TODO: IE6 only supports text zoom, check if it's IE6 first
354 void wxWebViewIE::Print()
356 m_webBrowser
->ExecWB(OLECMDID_PRINTPREVIEW
,
357 OLECMDEXECOPT_DODEFAULT
, NULL
, NULL
);
360 bool wxWebViewIE::CanGoBack()
363 return m_historyPosition
> 0;
368 bool wxWebViewIE::CanGoForward()
371 return m_historyPosition
!= m_historyList
.size() - 1;
376 void wxWebViewIE::LoadHistoryItem(wxWebHistoryItem
* item
)
379 for(unsigned int i
= 0; i
< m_historyList
.size(); i
++)
381 if(m_historyList
[i
].get() == item
)
384 wxASSERT_MSG(pos
!= m_historyList
.size(), "invalid history item");
385 m_historyLoadingFromList
= true;
386 LoadUrl(item
->GetUrl());
387 m_historyPosition
= pos
;
390 void wxWebViewIE::GoBack()
392 LoadHistoryItem(m_historyList
[m_historyPosition
- 1].get());
395 void wxWebViewIE::GoForward()
397 LoadHistoryItem(m_historyList
[m_historyPosition
+ 1].get());
400 void wxWebViewIE::Stop()
402 wxVariant out
= m_ie
.CallMethod("Stop");
404 // FIXME: why is out value null??
405 //return (HRESULT)(out.GetLong()) == S_OK;
408 void wxWebViewIE::ClearHistory()
410 m_historyList
.clear();
411 m_historyPosition
= -1;
414 void wxWebViewIE::EnableHistory(bool enable
)
416 m_historyEnabled
= enable
;
417 m_historyList
.clear();
418 m_historyPosition
= -1;
421 void wxWebViewIE::Reload(wxWebViewReloadFlags flags
)
425 V_VT(&level
) = VT_I2
;
429 case wxWEB_VIEW_RELOAD_DEFAULT
:
430 V_I2(&level
) = REFRESH_NORMAL
;
432 case wxWEB_VIEW_RELOAD_NO_CACHE
:
433 V_I2(&level
) = REFRESH_COMPLETELY
;
436 wxFAIL_MSG("Unexpected reload type");
439 m_webBrowser
->Refresh2(&level
);
442 bool wxWebViewIE::IsOfflineMode()
444 wxVariant out
= m_ie
.GetProperty("Offline");
446 wxASSERT(out
.GetType() == "bool");
448 return out
.GetBool();
451 void wxWebViewIE::SetOfflineMode(bool offline
)
453 // FIXME: the wxWidgets docs do not really document what the return
454 // parameter of PutProperty is
455 const bool success
= m_ie
.PutProperty("Offline", (offline
?
461 bool wxWebViewIE::IsBusy()
463 if (m_isBusy
) return true;
465 wxVariant out
= m_ie
.GetProperty("Busy");
467 wxASSERT(out
.GetType() == "bool");
469 return out
.GetBool();
472 wxString
wxWebViewIE::GetCurrentURL()
474 wxVariant out
= m_ie
.GetProperty("LocationURL");
476 wxASSERT(out
.GetType() == "string");
477 return out
.GetString();
480 wxString
wxWebViewIE::GetCurrentTitle()
482 wxVariant out
= m_ie
.GetProperty("LocationName");
484 wxASSERT(out
.GetType() == "string");
485 return out
.GetString();
488 void wxWebViewIE::onActiveXEvent(wxActiveXEvent
& evt
)
490 if (m_webBrowser
== NULL
) return;
492 switch (evt
.GetDispatchId())
494 case DISPID_BEFORENAVIGATE2
:
498 wxString url
= evt
[1].GetString();
499 wxString target
= evt
[3].GetString();
501 wxWebNavigationEvent
event(wxEVT_COMMAND_WEB_VIEW_NAVIGATING
,
502 GetId(), url
, target
, true);
503 event
.SetEventObject(this);
504 HandleWindowEvent(event
);
506 if (event
.IsVetoed())
508 wxActiveXEventNativeMSW
* nativeParams
=
509 evt
.GetNativeParameters();
510 *V_BOOLREF(&nativeParams
->pDispParams
->rgvarg
[0]) = VARIANT_TRUE
;
513 // at this point, either the navigation event has been cancelled
514 // and we're not busy, either it was accepted and IWebBrowser2's
515 // Busy property will be true; so we don't need our override
522 case DISPID_NAVIGATECOMPLETE2
:
524 wxString url
= evt
[1].GetString();
525 // TODO: set target parameter if possible
526 wxString target
= wxEmptyString
;
527 wxWebNavigationEvent
event(wxEVT_COMMAND_WEB_VIEW_NAVIGATED
,
528 GetId(), url
, target
, false);
529 event
.SetEventObject(this);
530 HandleWindowEvent(event
);
534 case DISPID_PROGRESSCHANGE
:
540 case DISPID_DOCUMENTCOMPLETE
:
542 //Only send a complete even if we are actually finished, this brings
543 //the event in to line with webkit
545 m_webBrowser
->get_ReadyState( &rs
);
546 if(rs
!= READYSTATE_COMPLETE
)
549 wxString url
= evt
[1].GetString();
550 //As we are complete we also add to the history list
551 if(m_historyEnabled
&& !m_historyLoadingFromList
)
553 //If we are not at the end of the list, then erase everything
554 //between us and the end before adding the new page
555 if(m_historyPosition
!= m_historyList
.size() - 1)
557 m_historyList
.erase(m_historyList
.begin() + m_historyPosition
+ 1,
558 m_historyList
.end());
560 wxSharedPtr
<wxWebHistoryItem
> item(new wxWebHistoryItem(url
, GetCurrentTitle()));
561 m_historyList
.push_back(item
);
564 //Reset as we are done now
565 m_historyLoadingFromList
= false;
566 // TODO: set target parameter if possible
567 wxString target
= wxEmptyString
;
568 wxWebNavigationEvent
event(wxEVT_COMMAND_WEB_VIEW_LOADED
, GetId(),
570 event
.SetEventObject(this);
571 HandleWindowEvent(event
);
575 case DISPID_STATUSTEXTCHANGE
:
580 case DISPID_TITLECHANGE
:
585 case DISPID_NAVIGATEERROR
:
587 wxWebNavigationError errorType
= wxWEB_NAV_ERR_OTHER
;
588 wxString errorCode
= "?";
589 switch (evt
[3].GetLong())
591 case INET_E_INVALID_URL
: // (0x800C0002L or -2146697214)
592 errorCode
= "INET_E_INVALID_URL";
593 errorType
= wxWEB_NAV_ERR_REQUEST
;
595 case INET_E_NO_SESSION
: // (0x800C0003L or -2146697213)
596 errorCode
= "INET_E_NO_SESSION";
597 errorType
= wxWEB_NAV_ERR_CONNECTION
;
599 case INET_E_CANNOT_CONNECT
: // (0x800C0004L or -2146697212)
600 errorCode
= "INET_E_CANNOT_CONNECT";
601 errorType
= wxWEB_NAV_ERR_CONNECTION
;
603 case INET_E_RESOURCE_NOT_FOUND
: // (0x800C0005L or -2146697211)
604 errorCode
= "INET_E_RESOURCE_NOT_FOUND";
605 errorType
= wxWEB_NAV_ERR_NOT_FOUND
;
607 case INET_E_OBJECT_NOT_FOUND
: // (0x800C0006L or -2146697210)
608 errorCode
= "INET_E_OBJECT_NOT_FOUND";
609 errorType
= wxWEB_NAV_ERR_NOT_FOUND
;
611 case INET_E_DATA_NOT_AVAILABLE
: // (0x800C0007L or -2146697209)
612 errorCode
= "INET_E_DATA_NOT_AVAILABLE";
613 errorType
= wxWEB_NAV_ERR_NOT_FOUND
;
615 case INET_E_DOWNLOAD_FAILURE
: // (0x800C0008L or -2146697208)
616 errorCode
= "INET_E_DOWNLOAD_FAILURE";
617 errorType
= wxWEB_NAV_ERR_CONNECTION
;
619 case INET_E_AUTHENTICATION_REQUIRED
: // (0x800C0009L or -2146697207)
620 errorCode
= "INET_E_AUTHENTICATION_REQUIRED";
621 errorType
= wxWEB_NAV_ERR_AUTH
;
623 case INET_E_NO_VALID_MEDIA
: // (0x800C000AL or -2146697206)
624 errorCode
= "INET_E_NO_VALID_MEDIA";
625 errorType
= wxWEB_NAV_ERR_REQUEST
;
627 case INET_E_CONNECTION_TIMEOUT
: // (0x800C000BL or -2146697205)
628 errorCode
= "INET_E_CONNECTION_TIMEOUT";
629 errorType
= wxWEB_NAV_ERR_CONNECTION
;
631 case INET_E_INVALID_REQUEST
: // (0x800C000CL or -2146697204)
632 errorCode
= "INET_E_INVALID_REQUEST";
633 errorType
= wxWEB_NAV_ERR_REQUEST
;
635 case INET_E_UNKNOWN_PROTOCOL
: // (0x800C000DL or -2146697203)
636 errorCode
= "INET_E_UNKNOWN_PROTOCOL";
637 errorType
= wxWEB_NAV_ERR_REQUEST
;
639 case INET_E_SECURITY_PROBLEM
: // (0x800C000EL or -2146697202)
640 errorCode
= "INET_E_SECURITY_PROBLEM";
641 errorType
= wxWEB_NAV_ERR_SECURITY
;
643 case INET_E_CANNOT_LOAD_DATA
: // (0x800C000FL or -2146697201)
644 errorCode
= "INET_E_CANNOT_LOAD_DATA";
645 errorType
= wxWEB_NAV_ERR_OTHER
;
647 case INET_E_CANNOT_INSTANTIATE_OBJECT
:
648 // CoCreateInstance will return an error code if this happens,
649 // we'll handle this above.
652 case INET_E_REDIRECT_FAILED
: // (0x800C0014L or -2146697196)
653 errorCode
= "INET_E_REDIRECT_FAILED";
654 errorType
= wxWEB_NAV_ERR_OTHER
;
656 case INET_E_REDIRECT_TO_DIR
: // (0x800C0015L or -2146697195)
657 errorCode
= "INET_E_REDIRECT_TO_DIR";
658 errorType
= wxWEB_NAV_ERR_REQUEST
;
660 case INET_E_CANNOT_LOCK_REQUEST
: // (0x800C0016L or -2146697194)
661 errorCode
= "INET_E_CANNOT_LOCK_REQUEST";
662 errorType
= wxWEB_NAV_ERR_OTHER
;
664 case INET_E_USE_EXTEND_BINDING
: // (0x800C0017L or -2146697193)
665 errorCode
= "INET_E_USE_EXTEND_BINDING";
666 errorType
= wxWEB_NAV_ERR_OTHER
;
668 case INET_E_TERMINATED_BIND
: // (0x800C0018L or -2146697192)
669 errorCode
= "INET_E_TERMINATED_BIND";
670 errorType
= wxWEB_NAV_ERR_OTHER
;
672 case INET_E_INVALID_CERTIFICATE
: // (0x800C0019L or -2146697191)
673 errorCode
= "INET_E_INVALID_CERTIFICATE";
674 errorType
= wxWEB_NAV_ERR_CERTIFICATE
;
676 case INET_E_CODE_DOWNLOAD_DECLINED
: // (0x800C0100L or -2146696960)
677 errorCode
= "INET_E_CODE_DOWNLOAD_DECLINED";
678 errorType
= wxWEB_NAV_ERR_USER_CANCELLED
;
680 case INET_E_RESULT_DISPATCHED
: // (0x800C0200L or -2146696704)
681 // cancel request cancelled...
682 errorCode
= "INET_E_RESULT_DISPATCHED";
683 errorType
= wxWEB_NAV_ERR_OTHER
;
685 case INET_E_CANNOT_REPLACE_SFP_FILE
: // (0x800C0300L or -2146696448)
686 errorCode
= "INET_E_CANNOT_REPLACE_SFP_FILE";
687 errorType
= wxWEB_NAV_ERR_SECURITY
;
689 case INET_E_CODE_INSTALL_BLOCKED_BY_HASH_POLICY
:
690 errorCode
= "INET_E_CODE_INSTALL_BLOCKED_BY_HASH_POLICY";
691 errorType
= wxWEB_NAV_ERR_SECURITY
;
693 case INET_E_CODE_INSTALL_SUPPRESSED
:
694 errorCode
= "INET_E_CODE_INSTALL_SUPPRESSED";
695 errorType
= wxWEB_NAV_ERR_SECURITY
;
699 wxString url
= evt
[1].GetString();
700 wxString target
= evt
[2].GetString();
701 wxWebNavigationEvent
event(wxEVT_COMMAND_WEB_VIEW_ERROR
, GetId(),
703 event
.SetEventObject(this);
704 event
.SetInt(errorType
);
705 event
.SetString(errorCode
);
706 HandleWindowEvent(event
);
710 case DISPID_COMMANDSTATECHANGE
:
712 long commandId
= evt
[0].GetLong();
713 bool enable
= evt
[1].GetBool();
714 if (commandId
== CSC_NAVIGATEBACK
)
716 m_canNavigateBack
= enable
;
718 else if (commandId
== CSC_NAVIGATEFORWARD
)
720 m_canNavigateForward
= enable
;
724 case DISPID_NEWWINDOW3
:
726 wxString url
= evt
[4].GetString();
728 wxWebNavigationEvent
event(wxEVT_COMMAND_WEB_VIEW_NEWWINDOW
,
729 GetId(), url
, wxEmptyString
, true);
730 event
.SetEventObject(this);
731 HandleWindowEvent(event
);
733 //If we veto the event then we cancel the new window
734 if (event
.IsVetoed())
736 wxActiveXEventNativeMSW
* nativeParams
= evt
.GetNativeParameters();
737 *V_BOOLREF(&nativeParams
->pDispParams
->rgvarg
[3]) = VARIANT_TRUE
;