The ActiveMovie Control supports the following events.
Event | Description |
DisplayModeChange | Indicates changes to the DisplayMode property. |
Error | Indicates that an error occurred. |
OpenComplete | Specifies the state of readiness for this ActiveMovie Control, based on how completely the source file has loaded. |
PositionChange | Indicates changes to the current media position, such as when the user selects (or seeks to) a new media position. |
ReadyStateChange | Indicates changes to the control's state of readiness. |
StateChange | Indicates player state changes. |
Timer | Handles timer events. |
The ActiveMovie Control also supports several events common to other controls: Click, DblClick, KeyDown, KeyPress, KeyUp, MouseDown, MouseMove, and MouseUp. For information about these events, see the event documentation for Visual Basic.
Indicates changes to the DisplayMode property, such as from full-screen to half.
Private Sub object_DisplayModeChange()
The DisplayModeChange event is raised when the DisplayMode property changes. The current display mode appears in the DisplayMode property. State flags are listed under DisplayMode property.
Indicates that an error occurred.
Private Sub object_Error(ByVal SCode As Integer, ByVal Description As String, ByVal Source As String, CancelDisplay As Boolean)
The Error event is sent when DirectShow reports an error during playback. By default, the ActiveMovie Control displays a message box containing the description string. To avoid displaying this box, set the CancelDisplay parameter of the Error event to False.
Indicates the control finished opening the media file and is ready for playback.
Private Sub object_OpenComplete()
This event is provided for backward compatibility; use the ReadyStateChange event instead.
Indicates changes to the current media position, such as when the user selects (or seeks to) a new media position.
Private Sub object_PositionChange(ByVal oldPosition As Double, ByVal newPosition As Double)
Changes made directly to the CurrentPosition property do not trigger this event.
Indicates changes to the control's state of readiness.
Private Sub object_ReadyStateChange(ByVal ReadyState As Long)
When you change the FileName property, applications should check the control's state of readiness before attempting to call the Run method on the newly opened file. Applications should call the Run method only if the ReadyState parameter equals amvInteractive or amvComplete.
Settings
Following are possible settings for the ReadyState parameter.
Setting | Value | Description |
amvUninitialized | 1 | The FileName property has not been initialized. |
amvLoading | 0 | The ActiveMovie Control is asynchronously loading a file. |
amvInteractive | 3 | The control loaded a file, and downloaded enough data to play the file, but has not yet received all data. |
amvComplete | 4 | All data has been downloaded. |
Indicates that the player state changed, such as from running to stopped.
Private Sub object_StateChange(ByVal oldState As Long, ByVal newState As Long)
The ActiveMovie Control raises the StateChange event when the player state changes, such as from stopped to running. The current player state appears in the CurrentState property. You can find the player state flags in the CurrentState property documentation.
Settings
Following are possible settings for the oldState or newState parameters.
Setting | Value | Description |
amvStopped | 0 | The player is stopped. |
amvPaused | 1 | The player is paused. |
amvRunning | 2 | The player is playing the multimedia file. |
Provides the rate at which DirectShow refreshes the control panel's display.
Private Sub object_Timer( )
The Timer event is raised at the intervals specified by the control's timer.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.