IVideoWindow Object

The IVideoWindow object supports the video window properties of a video renderer. It is a dual interface, accessible through Microsoft® Visual Basic® and Microsoft® 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

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

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.

AutoShow Property (IVideoWindow Object)

IVideoWindow Object

Retrieves or sets information about whether the window will be automatically shown.

Syntax

objVideoWindow.AutoShow [= boolean]

Parts

objVideoWindow
Object expression that evaluates to an IVideoWindow object.
boolean
True means the window will be made visible when the state is changed.

Remarks

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.

BackgroundPalette Property (IVideoWindow Object)

IVideoWindow Object

Determines whether any palette required will be realized in the background.

Syntax

objVideoWindow.BackgroundPalette [= boolean]

Parts

objVideoWindow
Object expression that evaluates to an IVideoWindow object.
boolean
Flag that indicates whether the palette will be realized.

Remarks

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).

BorderColor Property (IVideoWindow Object)

IVideoWindow Object

Retrieves or sets the border color for the video window.

Syntax

objVideoWindow.BorderColor [= Color]

Parts

objVideoWindow
Object expression that evaluates to an IVideoWindow object.
Color
New border color.

Remarks

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.

Caption Property (IVideoWindow Object)

IVideoWindow Object

Retrieves or sets the textual title string for the video window.

Syntax

objVideoWindow.Caption [= string]

Parts

objVideoWindow
Object expression that evaluates to an IVideoWindow object.
string
New value for the window title caption.

FullScreenMode Property (IVideoWindow Object)

IVideoWindow Object

Retrieves or sets a flag indicating whether to use full-screen mode for the video window.

Syntax

objVideoWindow.FullScreenMode [= boolean]

Parts

objVideoWindow
Object expression that evaluates to an IVideoWindow object.
boolean
New flag value. True means use full-screen mode; False means do not use full-screen mode.

GetMaxIdealImageSize Method (IVideoWindow Object)

IVideoWindow Object

Retrieves the ideal maximum image size for the video image playback (client) area.

Syntax

objVideoWindow.GetMaxIdealImageSize Width, Height

Parts

objVideoWindow
Object expression that evaluates to an IVideoWindow object.
Width
Long value that will contain the image width.
Height
Long value that will contain the image height.

GetMinIdealImageSize Method (IVideoWindow Object)

IVideoWindow Object

Gets the ideal minimum image size for the video image playback (client) area.

Syntax

objVideoWindow.GetMinIdealImageSize Width, Height

Parts

objVideoWindow
An object expression that evaluates to an IVideoWindow object.
Width
Long value that will contain the image width.
Height
Long value that will contain the image height.

GetRestorePosition Method (IVideoWindow Object)

IVideoWindow Object

Retrieves the size and position of the window when it is to be restored after being minimized.

Syntax

objVideoWindow.GetRestorePosition Left, Top, Width, Height

Parts

objVideoWindow
Object expression that evaluates to an IVideoWindow object.
Left
Returns the x-axis origin of the video window.
Top
Returns the y-axis origin of the video window.
Width
Returns the width of the video window.
Height
Returns the height of the video window.

GetWindowPosition Method (IVideoWindow Object)

IVideoWindow Object

Retrieves the current window rectangle (not the client rectangle) in device coordinates.

Syntax

objVideoWindow.GetWindowPosition Left, Top, Width, Height

Parts

objVideoWindow
Object expression that evaluates to an IVideoWindow object.
Left
Returns the x-axis origin of the window.
Top
Returns the y-axis origin of the window.
Width
Returns the width of the window.
Height
Returns the height of the window.

Remarks

This method has the same effect as individually setting the Left, Top, Width, and Height properties.

Height Property (IVideoWindow Object)

IVideoWindow Object

Retrieves or sets the height of the video window.

Syntax

objVideoWindow.Height [= lValue]

Parts

objVideoWindow
Object expression that evaluates to an IVideoWindow object.
lValue
New value for the vertical dimension of the video window.

Remarks

Changes to the Height property are independent of the Width property (the y-coordinate of the video window).

HideCursor Method (IVideoWindow Object)

IVideoWindow Object

Specifies whether the cursor is visible or hidden when it passes over the video playback window.

Syntax

objVideoWindow.HideCursor bValue

Parts

objVideoWindow
Object expression that evaluates to an IVideoWindow object.
bValue
Boolean value that specifies whether the cursor is visible or not; True hides the cursor and False makes it visible.

Remarks

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

IsCursorHidden Method (IVideoWindow Object)

IVideoWindow Object

Retrieves whether the cursor is visible or not.

Syntax

objVideoWindow.IsCursorHidden bValue

Parts

objVideoWindow
Object expression that evaluates to an IVideoWindow object.
bValue
Boolean value that will contain the cursor's state of visibility; True if the cursor is hidden and False if it is visible.

Remarks

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

Left Property (IVideoWindow Object)

IVideoWindow Object

Retrieves or sets the x-coordinate for the video window.

Syntax

objVideoWindow.Left [= lValue]

Parts

objVideoWindow
Object expression that evaluates to an IVideoWindow object.
lValue
New value for the x-axis coordinate.

Remarks

Calling this method does not affect the width of the video window.

MessageDrain Property (IVideoWindow Object)

IVideoWindow Object

Retrieves or sets the window handle of the window that receives posted messages for the video window.

Syntax

objVideoWindow.MessageDrain [= handle]

Parts

objVideoWindow
Object expression that evaluates to an IVideoWindow object.
handle
New value for the window handle.

NotifyOwnerMessage Method (IVideoWindow Object)

IVideoWindow Object

Forwards messages that have been received by a parent window to a child window owned by a filter.

Syntax

objVideoWindow.NotifyOwnerMessage hwnd, uMsg, wParam, lParam

Parts

objVideoWindow
Object expression that evaluates to an IVideoWindow object.
hwnd
Window handle.
uMsg
Message being sent.
wParam
Message's wParam.
lParam
Message's lParam.

Owner Property (IVideoWindow Object)

IVideoWindow Object

Retrieves or sets the owning parent for the video window.

Syntax

objVideoWindow.Owner [= handle]

Parts

objVideoWindow
Object expression that evaluates to an IVideoWindow object.
handle
New value for the window handle.

Remarks

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.

SetWindowForeground Method (IVideoWindow Object)

IVideoWindow Object

Sets the video window as the foreground window and optionally gives it focus.

Syntax

objVideoWindow.SetWindowForeground Focus

Parts

objVideoWindow
Object expression that evaluates to an IVideoWindow object.
Focus
Long value that specifies whether the video window will have focus. A value of –1 gives the window focus and 0 does not.

SetWindowPosition Method (IVideoWindow Object)

IVideoWindow Object

Sets the position of the video window (not the client rectangle position) in device coordinates.

Syntax

objVideoWindow.SetWindowPosition Left, Top, Width, Height

Parts

objVideoWindow
Object expression that evaluates to an IVideoWindow object.
Left
Specifies the x-axis origin of the window.
Top
Specifies the y-axis origin of the window.
Width
Specifies the width of the window.
Height
Specifies the height of the window.

Remarks

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.

Top Property (IVideoWindow Object)

IVideoWindow Object

Retrieves or sets the y-axis coordinate of the video window.

Syntax

objVideoWindow.Top [= lValue]

Parts

objVideoWindow
Object expression that evaluates to an IVideoWindow object.
lValue
New value for the y-axis origin.

Remarks

Calling this method does not affect the height of the video window.

Visible Property (IVideoWindow Object)

IVideoWindow Object

Retrieves or sets the visibility of the video window.

Syntax

objVideoWindow.Visible [= boolean]

Parts

objVideoWindow
Object expression that evaluates to an IVideoWindow object.
boolean
If set to True, the window is shown; if False, the window is hidden.

Width Property (IVideoWindow Object)

IVideoWindow Object

Retrieves or sets the width of the video window.

Syntax

objVideoWindow.Width [= lValue]

Parts

objVideoWindow
Object expression that evaluates to an IVideoWindow object.
lValue
New value of the width.

Remarks

The Width property is independent of the video window's Height property (the x-coordinate).

WindowState Property (IVideoWindow Object)

IVideoWindow Object

Returns or sets the state of the video window.

Syntax

objVideoWindow.WindowState [= lValue]

Parts

objVideoWindow
Object expression that evaluates to an IVideoWindow object.
lValue
New value for the WindowState property.

WindowStyle Property (IVideoWindow Object)

IVideoWindow Object

Retrieves or sets the style parameters for the video window.

Syntax

objVideoWindow.WindowStyle [= lValue]

Parts

objVideoWindow
Object expression that evaluates to an IVideoWindow object.
lValue
New value for the WindowStyle property.

Remarks

For a complete list of window styles, see the CreateWindow function in the Microsoft® Platform Software Development Kit (SDK).

WindowStyleEx Property (IVideoWindow Object)

IVideoWindow Object

Changes the style parameters for the video window.

Syntax

objVideoWindow.WindowStyleEx [= lValue]

Parts

objVideoWindow
Object expression that evaluates to an IVideoWindow object.
lValue
New value for the flags. Valid values include only those flags that can be set by the GWL_STYLE value of the Microsoft Win32 GetWindowLong function.

Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.