Share via


BeforeWindowOpen (Windows Embedded CE 6.0)

1/6/2010

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, a new window opens with about:blank displayed in the address bar.

    Note

    Some Web site scripts start popup Windows without specifying the URL of the page to display, and then browse to the page in a separate call. Such popups cannot be filtered.

  • urlContext
    [in] BSTR that specifies the URL of the active 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 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 and toolbar=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 as usual 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 raise a script error related to the error code

Requirements

Header interned.h
Windows Embedded CE Windows CE 5.0 and later

See Also

Concepts

IHTMLCEClientServices:IUnknown
Using the Popup Blocker Interfaces