SHDocVw.TWebBrowserNewWindow2

From RAD Studio API Documentation
Jump to: navigation, search

C++

typedef void __fastcall (__closure *TWebBrowserNewWindow2)(System::TObject* ASender, _di_IDispatch &ppDisp, System::WordBool &Cancel);

Properties

Type Visibility Source Unit Parent
typedef public SHDocVw.hpp SHDocVw SHDocVw

Description

TWebBrowserNewWindow2 is the type for the OnNewWindow2 event handler on TWebBrowser.

Sender is the WebBrowser that needs a new window to display its target resource.

ppDisp optionally returns the interface for a newly created, hidden, TWebBrowser component that can act as the new window. The Web browser configures this component and navigates to the target URL, starting with an OnBeforeNavigate2 event. If the event handler does not create a component and return its interface as the ppDisp parameter, the Web browser generates a top-level window as a separate, nonhosted process.

Cancel allows the event handler to block the creation of a new window. When the event handler sets Cancel to true, the Web browser tries to display the target resource in its current window, starting with an OnBeforeNavigate2 event.

Note: The event handler should not return a value for ppDisp when setting Cancel to true.