BeforeWindowOpen (Windows CE 5.0)
This method is called before a Web page script calls window.open.
HRESULT BeforeWindowOpen( BSTR url, BSTR urlContext, BSTR name, BSTR features, IUnknown* punkEvents);
Parameters
url
[in] BSTR that specifies the URL of the document to display in the popup Window. Client applications can use this parameter to block specific Web pages. If the URL is not specified, then a new window opens with about:blank displayed in the address bar.Note Some Web site scripts launch popup Windows without specifying the URL of the page to display, and then navigate to the page in a separate call. Such popups cannot be filtered.
urlContext
[in] BSTR that specifies the URL of the current window. Client applications can use this parameter to block specific Web pages.name
[in] BSTR that specifies the name of the window. This parameter value is used for the TARGET attribute on a form or an element. This is part of the window.open call and is the target name of the new window. For more information about some of the standard values for this field, see IHTMLWindow2::open documentation.features
[in] BSTR that specifies a comma-delimited list of window feature items. Each item in the list consists of an option and a value, separated by the equal sign (=). For example,fullscreen=yes
andtoolbar=yes
. For more information about the list of standard features, see IHTMLWindow2::open documentation.punkEvents
[in] Points to IUnknown that implements the IHTMLCEPopupEvents interface. This parameter provides a pointer to the stack of events that resulted in the window.open call. Use this paramter for advanced filtering of popup windows.
Return Values
The following table shows the possible return values.
Value | Description |
---|---|
S_OK | Indicates that the window.open call is allowed and the new window opens. |
S_FALSE | Indicates that the window.open call should be blocked. The call fails internally and a new window is not created. Any attempt to use the returned window object in script results in a script error. |
E_NOTIMPL | Indicates that the window.open call proceeds normally as if no popup blocking were present. |
E_FAIL (or other error codes) | Indicates that the window.open call failed and passes the error code up to the script engine that may fire a script error related to the error code. |
Requirements
OS Versions: Windows CE 5.0 and later.
Header: Interned.h .h.
See Also
Using the Popup Blocker Interfaces
Send Feedback on this topic to the authors