Plays an AVI clip in an animation control
#include <GuiAVI.au3>
_GUICtrlAVI_Play ( $hWnd [, $iFrom = 0 [, $iTo = -1 [, $iRepeat = -1]]] )
$hWnd | Control ID/Handle to the control |
$iFrom | [optional] 0-based index of the frame where playing begins. The value must be less than 65,536. A value of 0 means begin with the first frame in the clip. |
$iTo | [optional] 0-based index of the frame where playing ends. The value must be less than 65,536. A value of -1 means end with the last frame in the clip. |
$iRepeat | [optional] Number of times to replay the AVI clip. A value of -1 means replay the clip indefinitely. |
Success: | True. |
Failure: | False. |
The control plays the clip in the background while the thread continues executing.
_GUICtrlAVI_Seek, _GUICtrlAVI_Stop
; using AutoIt Function
#include <GuiAVI.au3>
#include <GUIConstantsEx.au3>
_Example_Internal()
Func _Example_Internal()
Local $idAVI, $id_Start, $id_Stop
; Create GUI
GUICreate("(Internal) AVI Play/Stop", 300, 200)
$idAVI = GUICtrlCreateAvi(@SystemDir & "\shell32.dll", 160, 10, 10)
$id_Start = GUICtrlCreateButton("start", 50, 150, 70, 22)
$id_Stop = GUICtrlCreateButton("stop", 150, 150, 70, 22)
GUISetState(@SW_SHOW)
; Loop until the user exits.
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $id_Start
; Play part of the AVI clip
_GUICtrlAVI_Play($idAVI)
Case $id_Stop
; Stop AVI clip
_GUICtrlAVI_Stop($idAVI)
EndSwitch
WEnd
; Close AVI clip
_GUICtrlAVI_Close($idAVI)
GUIDelete()
EndFunc ;==>_Example_Internal
; using UDF
#include <GuiAVI.au3>
#include <GUIConstantsEx.au3>
_Example_External()
Func _Example_External()
Local $hGUI, $hAVI, $id_Start, $id_Stop
; Create GUI
$hGUI = GUICreate("(External) AVI Play/Stop", 300, 200)
$hAVI = _GUICtrlAVI_Create($hGUI, @SystemDir & "\Shell32.dll", 160, 10, 10)
$id_Start = GUICtrlCreateButton("start", 50, 150, 70, 22)
$id_Stop = GUICtrlCreateButton("stop", 150, 150, 70, 22)
GUISetState(@SW_SHOW)
; Loop until the user exits.
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $id_Start
; Play part of the AVI clip
_GUICtrlAVI_Play($hAVI)
Case $id_Stop
; Stop AVI clip
_GUICtrlAVI_Stop($hAVI)
EndSwitch
WEnd
; Close AVI clip
_GUICtrlAVI_Close($hAVI)
GUIDelete()
EndFunc ;==>_Example_External