The IVideoWindow object supports the video window properties of a video renderer. It is a dual interface, accessible through Visual Basic® and Visual C++®, that controls a generic video window. Generally, this is a video renderer that draws video into a window on the display.
The IVideoWindow object supports both properties and methods. When operations require several properties to be changed simultaneously; methods are provided that allow a number of related properties to be changed simultaneously. For example, setting the position and size of the window can be done by four individual property calls or by the single method SetWindowPosition.
The video renderer must be connected to use the IVideoWindow properties and methods.
Properties
Name | Description |
AutoShow | Retrieves or sets the flag that specifies if the window will be automatically shown on the first state change. |
BackgroundPalette | Retrieves or sets the flag that indicates whether the renderer realizes its palette in the background. |
BorderColor | Retrieves or sets the border color for the video window. |
Caption | Retrieves or sets the text caption on the playback window. |
FullScreenMode | Retrieves or sets the type of full-screen mode. |
Height | Retrieves or sets the height of the video window. |
Left | Retrieves or sets the x-axis coordinate for the video window. |
MessageDrain | Retrieves or sets a window handle that is used by the video window to receive or post messages. |
NotifyOwnerMessage | Forwards messages that have been received by a parent window to a child window owned by a filter. |
Owner | Retrieves or sets the owning parent window for the video playback window. |
Top | Retrieves or sets the y-axis coordinates for the video window. |
Visible | Retrieves or sets the visibility of the window. |
Width | Retrieves or sets the width of the video window. |
WindowState | Retrieves or sets the current window state (such as visible or minimized). |
WindowStyle | Retrieves or sets the playback window style. |
WindowStyleEx | Retrieves or sets the playback window's extended style bits. |
Methods
Name | Description |
GetMaxIdealImageSize | Gets the ideal maximum image size for the video image playback (client) area. |
GetMinIdealImageSize | Gets the ideal minimum image size for the video image playback (client) area. |
GetRestorePosition | Retrieves the restored video window size when maximizing and minimizing. |
GetWindowPosition | Retrieves the video window position. |
HideCursor | Hides the cursor. |
IsCursorHidden | Retrieves whether the cursor is visible or not. |
NotifyOwnerMessage | Passes palette and color change messages on the filter graph. |
SetWindowForeground | Sets the video window as the foreground window and optionally gives it focus. |
SetWindowPosition | Sets the video window position on the display. |
Retrieves or sets information about whether the window will be automatically shown.
objVideoWindow.AutoShow [= boolean]
Many simple applications require a displayed window when a filter graph is set to the running state. This method is set on (1) by default so that when the graph changes state to paused or running, the window will be made visible (it will also be set to be the foreground window). It will be shown on all subsequent state changes to paused or running unless the window is closed, in which case it will not be shown again until the renderer goes through a stopped state. If this property is set to off (0), the window will remain hidden until explicitly shown. You can do this by setting the Visible property.
Determines whether any palette required will be realized in the background.
objVideoWindow.BackgroundPalette [= boolean]
If this is True (1), the renderer realizes any required video palette in the background. This means that any colors the palette uses will change to their closest match in the display palette prior to drawing. This ensures that an application will not have its palette disturbed when playing a video. It does, however, impose severe performance penalties on the video and should not be used unless absolutely necessary. The default value for this property is False (0).
Retrieves or sets the border color for the video window.
objVideoWindow.BorderColor [= Color]
When a destination rectangle that is set differs from the window's visible client area, a border is exposed around the edge. This method allows an application to change the border color. It is set to black by default. Any nonsystem color passed in is converted to its closest match, according to the current palette, before being used (this is not an issue on true-color devices). Setting this causes the window border to be repainted in the new color automatically.
Retrieves or sets the textual title string for the video window.
objVideoWindow.Caption [= string]
Retrieves or sets a flag indicating whether to use full-screen mode for the video window.
objVideoWindow.FullScreenMode [= boolean]
Retrieves the ideal maximum image size for the video image playback (client) area.
objVideoWindow.GetMaxIdealImageSize Width, Height
Gets the ideal minimum image size for the video image playback (client) area.
objVideoWindow.GetMinIdealImageSize Width, Height
Retrieves the size and position of the window when it is to be restored after being minimized.
objVideoWindow.GetRestorePosition Left, Top, Width, Height
Retrieves the current window rectangle (not the client rectangle) in device coordinates.
objVideoWindow.GetWindowPosition Left, Top, Width, Height
This method has the same effect as individually setting the Left, Top, Width, and Height properties.
Retrieves or sets the height of the video window.
objVideoWindow.Height [= lValue]
Changes to the Height property are independent of the Width property (the y-coordinate of the video window).
Specifies whether the cursor is visible or hidden when it passes over the video playback window.
objVideoWindow.HideCursor bValue
When you use full-screen playback, it is common to hide the cursor to avoid distracting the user.
The following code fragment shows how to use this method.
Dim o_objVideoWindow As IVideoWindow 'Initialize the IVideoWindow Object Dim g_objMediaControl As IMediaControl 'Initialize the IMediaControl Object Set g_objVideoWindow = g_objMediaControl 'Assign the playback window to the filter graph g_objVideoWindow.HideCursor (True) 'Hide the cursor
Retrieves whether the cursor is visible or not.
objVideoWindow.IsCursorHidden bValue
When you use full-screen playback, it is common to hide the cursor to avoid distracting the user.
The following code fragment shows how to use this method.
Dim o_objVideoWindow As IVideoWindow 'Initialize the IVideoWindow Object Dim g_objMediaControl As IMediaControl 'Initialize the IMediaControl Object Dim bTest As Boolean 'Initialize the storage variable Set g_objVideoWindow = g_objMediaControl 'Assign the playback window to the filter graph g_objVideoWindow.IsCursorHidden (bTest) 'Check if the cursor is hidden
Retrieves or sets the x-coordinate for the video window.
objVideoWindow.Left [= lValue]
Calling this method does not affect the width of the video window.
Retrieves or sets the window handle of the window that receives posted messages for the video window.
objVideoWindow.MessageDrain [= handle]
Forwards messages that have been received by a parent window to a child window owned by a filter.
objVideoWindow.NotifyOwnerMessage hwnd, uMsg, wParam, lParam
Retrieves or sets the owning parent for the video window.
objVideoWindow.Owner [= handle]
This property offers a way for applications to set the owner of the video window. This is often used when playing videos in compound documents.
Sets the video window as the foreground window and optionally gives it focus.
objVideoWindow.SetWindowForeground Focus
Sets the position of the video window (not the client rectangle position) in device coordinates.
objVideoWindow.SetWindowPosition Left, Top, Width, Height
Specify, in window coordinates, where the video should appear. For example, setting a destination of (100,50,200,400) positions the video playback at an origin of 100 pixels from the left of the client area, 50 pixels from the top, and with an overall size of 200 x 400 pixels. If the video is smaller than this (or a source rectangle has been specified that is smaller than the video), it will be stretched appropriately. Similarly, if the video is larger than the destination rectangle, the video is compressed into the visible rectangle. There are fairly severe performance penalties if an application does not keep the source and destination rectangles the same size.
Under typical circumstances, when no destination rectangle has been set, the video fills the entire visible client window area (regardless of how much the user has stretched the window). Also, the destination rectangle properties correctly return the size of the video window client area.
This method has the same effect as individually setting the Left, Top, Width, and Height properties.
Retrieves or sets the y-axis coordinate of the video window.
objVideoWindow.Top [= lValue]
Calling this method does not affect the height of the video window.
Retrieves or sets the visibility of the video window.
objVideoWindow.Visible [= boolean]
Retrieves or sets the width of the video window.
objVideoWindow.Width [= lValue]
The Width property is independent of the video window's Height property (the x-coordinate).
Returns or sets the state of the video window.
objVideoWindow.WindowState [= lValue]
Retrieves or sets the style parameters for the video window.
objVideoWindow.WindowStyle [= lValue]
For a complete list of window styles, see the CreateWindow function in the Microsoft® Platform Software Development Kit (SDK).
Changes the style parameters for the video window.
objVideoWindow.WindowStyleEx [= lValue]
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.