Function Reference


Creates an AVI video control for the GUI.

GUICtrlCreateAvi ( filename, subfileid, left, top [, width [, height [, style = -1 [, exStyle = -1]]]] )


filename The filename of the video. Only .avi files are supported.
subfileid id of the subfile to be used. If the file only contains one video then use 0.
left The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
top The top of the control. If -1 is used then top will be computed according to GUICoordMode.
width [optional] The width of the control (default is the previously used width).
height [optional] The height of the control (default is the previously used height).
style [optional] Defines the style of the control. See GUI Control Styles Appendix.
    default (-1) : $ACS_TRANSPARENT
    $ACS_TRANSPARENT is always used unless $ACS_NONTRANSPARENT is specified.
exStyle [optional] Defines the extended style of the control. See Extended Style Table.

Return Value

Success: the identifier (controlID) of the new control.
Failure: 0.


To obtain the value of the control see GUICtrlRead().
To set or change information in the control see GUICtrlUpdate...() functions.

To start the video as soon as the control is created use the $ACS_AUTOPLAY style.
You can can start and stop the animation by setting the state to 1 or 0 with GUICtrlSetState(). See example.

To combine styles with the default style use BitOR($GUI_SS_DEFAULT_AVI, newstyle, ... ).
To use the values specified above you must #include <AVIConstants.au3> in your script.

Default resizing is $GUI_DOCKSIZE.


GUICoordMode (option), GUICtrlUpdate..., GUIGetMsg


#include <GUIConstantsEx.au3>


Func Example()
    ; Create a GUI with various controls.
    Local $hGUI = GUICreate("Example", 300, 200)

    ; Create an animation control.
    Local $idAnimation = GUICtrlCreateAvi(@SystemDir & "\shell32.dll", 165, 15, 0, 300)
    Local $idStart = GUICtrlCreateButton("Start", 60, 150, 85, 25)
    Local $idStop = GUICtrlCreateButton("Stop", 160, 150, 85, 25)

    ; Display the GUI.
    GUISetState(@SW_SHOW, $hGUI)

    ; Loop until the user exits.
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE

            Case $idStart ; Start the animation.
                GUICtrlSetState($idAnimation, $GUI_AVISTART)

            Case $idStop ; Stop the animation.
                GUICtrlSetState($idAnimation, $GUI_AVISTOP)


    ; Delete the previous GUI and all controls.
EndFunc   ;==>Example