IVideoWindow interface (control.h)

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

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.

Inheritance

The IVideoWindow interface inherits from the IDispatch interface. IVideoWindow also has these types of members:

Methods

The IVideoWindow interface has these methods.

 
IVideoWindow::get_AutoShow

The get_AutoShow method queries whether the video renderer automatically shows the video window when it receives video data.
IVideoWindow::get_BackgroundPalette

The get_BackgroundPalette method queries whether the video window realizes its palette in the background..
IVideoWindow::get_BorderColor

The get_BorderColor method retrieves the color that appears around the edges of the destination rectangle.
IVideoWindow::get_Caption

The get_Caption method retrieves the video window caption.
IVideoWindow::get_FullScreenMode

The get_FullScreenMode method queries whether the video renderer is in full-screen mode.
IVideoWindow::get_Height

The get_Height method retrieves the height of the video window.
IVideoWindow::get_Left

The get_Left method retrieves the video window's x-axis coordinate.
IVideoWindow::get_MessageDrain

The get_MessageDrain method retrieves the window that receives mouse and keyboard messages from the video window, if any.
IVideoWindow::get_Owner

The get_Owner method retrieves the video window's parent window, if any.
IVideoWindow::get_Top

The get_Top method retrieves the video window's y-coordinate.
IVideoWindow::get_Visible

The get_Visible method queries whether the video window is visible.
IVideoWindow::get_Width

The get_Width method retrieves the width of the video window.
IVideoWindow::get_WindowState

The get_WindowState method queries whether the video window is visible, hidden, minimized, or maximized.
IVideoWindow::get_WindowStyle

The get_WindowStyle method retrieves the window styles on the video window.
IVideoWindow::get_WindowStyleEx

The get_WindowStyleEx method retrieves the extended window styles on the video window.
IVideoWindow::GetMaxIdealImageSize

The GetMaxIdealImageSize method retrieves the maximum ideal image size for the video image.
IVideoWindow::GetMinIdealImageSize

The GetMinIdealImageSize method retrieves the minimum ideal size for the video image.
IVideoWindow::GetRestorePosition

The GetRestorePosition method retrieves the restored window position.
IVideoWindow::GetWindowPosition

The GetWindowPosition method retrieves the position of the video window.
IVideoWindow::HideCursor

The HideCursor method shows or hides the cursor when the mouse is positioned over the video window.
IVideoWindow::IsCursorHidden

The IsCursorHidden method queries whether the cursor is hidden.
IVideoWindow::NotifyOwnerMessage

The NotifyOwnerMessage method forwards a message to the video window.
IVideoWindow::put_AutoShow

The put_AutoShow method specifies whether the video renderer automatically shows the video window when it receives video data.
IVideoWindow::put_BackgroundPalette

The put_BackgroundPalette method specifies whether the video window realizes its palette in the background.
IVideoWindow::put_BorderColor

The put_BorderColor method sets the color that appears around the edges of the destination rectangle.
IVideoWindow::put_Caption

The put_Caption method sets the video window caption.
IVideoWindow::put_FullScreenMode

The put_FullScreenMode method enables or disables full-screen video rendering.
IVideoWindow::put_Height

The put_Height method sets the height of the video window.
IVideoWindow::put_Left

The put_Left method sets the x-coordinate of the video window.
IVideoWindow::put_MessageDrain

The put_MessageDrain method specifies a window to receive mouse and keyboard messages from the video window.
IVideoWindow::put_Owner

The put_Owner method specifies a parent window for the video window.
IVideoWindow::put_Top

The put_Top method specifies the y-coordinate of the video window.
IVideoWindow::put_Visible

The put_Visible method shows or hides the video window.
IVideoWindow::put_Width

The put_Width method specifies the width of the video window.
IVideoWindow::put_WindowState

The put_WindowState method shows, hides, minimizes, or maximizes the video window.
IVideoWindow::put_WindowStyle

The put_WindowStyle method sets the window styles on the video window.
IVideoWindow::put_WindowStyleEx

The put_WindowStyleEx method sets the extended window styles on the video window.
IVideoWindow::SetWindowForeground

The SetWindowForeground method places the video window at the top of the Z order.
IVideoWindow::SetWindowPosition

The SetWindowPosition method sets the position of the video window.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header control.h (include Dshow.h)

See also

IDispatch