DWebBrowserEvents2::WindowStateChanged Event

Fires when the visibility state of a content window, such as the browser window or a tab, changes.

Syntax

void WindowStateChanged(      
    DWORD dwFlags,     DWORD dwValidFlagsMask );

Parameters

dwFlags
[in] The flags indicating the current window state.
OLECMDIDF_WINDOWSTATE_USERVISIBLE
The content window is visible to the user.
OLECMDIDF_WINDOWSTATE_ENABLED
The content window is enabled.
dwValidFlagsMask
[in] The flags indicating which flags in the dwFlags parameter value have been initialized.
OLECMDIDF_WINDOWSTATE_USERVISIBLE
The OLECMDIDF_WINDOWSTATE_USERVISIBLE flag can be checked.
OLECMDIDF_WINDOWSTATE_ENABLED
The OLECMDIDF_WINDOWSTATE_ENABLED flag can be checked.

Return Value

No return value.

Event DISPID

DISPID_WINDOWSTATECHANGED

The DISPID for this event is defined in exdispid.h. Use this value to identify the event handler when implementing IDispatch::Invoke.

Remarks

The DWebBrowserEvents2::WindowStateChanged event is raised when the state of a content window, such as the browser window or a tab, might have changed. The following actions raise this event.

  • The browser window is minimized or restored.
  • An active tab becomes inactive.
  • An inactive tab becomes active.
  • The browser window is enabled or disabled due to a modal dialog box.

A content window is visible to the user when it is displayed to the user and can be interacted with. If tabbed browsing is enabled, the active tab (the one with focus) contains the content window. Background tabs are inactive. When tabbed browsing is disabled, the browser window displays the content window. When the browser window is minimized, the content window is not visible. This event can be used to minimize CPU usage and prolong battery life by reducing unnecessary updates to inactive windows.

Note  This event can be raised even if the state of the parameter flag values have not changed.
Tags :


Page view tracker