Compartilhar via


IVideoWindow Interface

 
Microsoft DirectShow 9.0

IVideoWindow Interface

The IVideoWindow interface sets properties on the video window. Applications can use it to set the window owner, the position and dimensions of the window, and other properties.

Note   The IVMRWindowlessControl or IVMRWindowlessControl9 interface is now preferred over IVideoWindow. For more information, see Using Windowless Mode.

The Video Renderer filter and the Filter Graph Manager both expose this interface. The Filter Graph Manager forwards all method calls to the Video Renderer. It also forwards certain window messages that the Video Renderer needs to receive, such as WM_DISPLAYCHANGE. Because the video window is usually a child of an application window, the filter would not otherwise receive these messages. Therefore it relies on the Filter Graph Manager to forward them.

In most cases, an application should query the Filter Graph Manager for this interface, and not call the filter directly, because of the messaging issue just described. However, if the filter graph has more than one Video Renderer, the Filter Graph Manager only communicates with one of them, selected arbitrarily. Therefore, if your application uses multiple video windows, use the IVideoWindow interface directly on the filters. In that case, you must forward window messages to each Video Renderer instance, using the IVideoWindow::NotifyOwnerMessage method.

To prevent the video window from flickering during repaints, override the default handling for the WM_ERASEBKGND message and do not erase the window. (For MFC applications, override CWnd::OnEraseBkgnd with an empty handler.)

Properties set on a video renderer persist between successive connections and disconnections.

Because this interface is Automation-compatible, all Boolean values are defined as OAFALSE (0) and OATRUE (–1).

Error codes: If the video renderer filter is not connected to another filter, all methods return the error code VFW_E_NOT_CONNECTED. For the Filter Graph Manager's implementation, if the graph does not contain a video renderer filter, all methods return E_NOINTERFACE. Note that the Filter Graph Manager exposes the interface even when the graph does not contain a video renderer, so an application can query for the interface before it builds the graph.

Filter Developers: You can use the CBaseVideoWindow class to help implement this interface.

In addition to the methods inherited from IDispatch, the IVideoWindow interface exposes the following methods.

Method Description
get_AutoShow Queries whether the video renderer automatically shows the video window when it receives video data.
get_BackgroundPalette Queries whether the video window realizes its palette in the background.
get_BorderColor Retrieves the color that appears around the edges of the destination rectangle.
get_Caption Retrieves the video window caption.
get_FullScreenMode Queries whether the video renderer is in full-screen mode.
get_Height Retrieves the height of the video window.
get_Left Retrieves the video window's x-coordinate.
get_MessageDrain Retrieves the window that receives mouse and keyboard messages from the video window, if any.
get_Owner Retrieves the video window's parent window, if any.
get_Top Retrieves the video window's y-coordinate.
get_Visible Queries whether the video window is visible.
get_Width Retrieves the width of the video window.
get_WindowState Queries whether the video window is visible, hidden, minimized, or maximized.
get_WindowStyle Retrieves the window style on the video window.
get_WindowStyleEx Retrieves the extended window style on the video window.
GetMaxIdealImageSize Retrieves the maximum ideal size for the video image.
GetMinIdealImageSize Retrieves the minimum ideal size for the video image.
GetRestorePosition Retrieves the restored window position.
GetWindowPosition Retrieves the position of the video window.
HideCursor Hides the cursor.
IsCursorHidden Queries whether the cursor is hidden.
NotifyOwnerMessage Forwards a message to the video window.
put_AutoShow Specifies whether the video renderer automatically shows the video window when it receives video data.
put_BackgroundPalette Specifies whether the video window realizes its palette in the background.
put_BorderColor Sets the color that appears around the edges of the destination rectangle.
put_Caption Sets the video window caption.
put_FullScreenMode Enables or disables full-screen mode.
put_Height Sets the height of the video window.
put_Left Sets the video window's x-coordinate.
put_MessageDrain Specifies a window to receive mouse and keyboard messages from the video window.
put_Owner Specifies a parent window for the video window.
put_Top Sets the video window's y-coordinate.
put_Visible Shows or hides the video window.
put_Width Sets the width of the video window.
put_WindowState Shows, hides, minimizes, or maximizes the video window.
put_WindowStyle Sets the window style on the video window.
put_WindowStyleEx Sets the extended window style on the video window.
SetWindowForeground Places the video window at the top of the Z order.
SetWindowPosition Sets the position of the video window.

Requirements

Header: Declared in Control.h; include Dshow.h.

Library: Use Strmiids.lib.