Erstellt ein AVI-Control
#Include <GuiAVI.au3>
_GUICtrlAVI_Create($hWnd[, $sFile = ""[, $subfileid = -1[, $iX = 0[, $iY = 0[, $iWidth = 0[, $iHeight = 0[, $iStyle = 0x00000006[, $iExStyle = 0x00000000]]]]]]]])
Parameter
| $hWnd | Handle zum Parent- oder Eigner-Fenster |
| $sFile | [optional] Der Dateiname vom Video. Es werden nur .avi Dateien unterstützt. |
| $subfileid | [optional] ID der zu verwendenden Unterdatei. |
| $iX | [optional] Horizontale Position des Controls |
| $iY | [optional] Vertikale Position des Controls |
| $iWidth | [optional] Breite des Controls |
| $iHeight | [optional] Höhe des Controls |
| $iStyle | [optional] Stile des Controls: $ACS_CENTER - Zentriert das Video im Control-Fenster $ACS_TRANSPARENT - Erlaubt es, die Hintergrundfarbe des Anzeigefensters an die Farbe des darunterliegenden Fensters anzupassen, so dass der Hintergrund "transparent" wird $ACS_AUTOPLAY - Beginnt mit dem Abspielen des Videos sobald der AVI-Clip geöffnet wird $ACS_TIMER - Das Control spielt den Clips ohne das Erstellen eines Themas Standard: $ACS_TRANSPARENT, $ACS_AUTOPLAY Erzwungen : $WS_CHILD, $WS_VISIBLE |
| $iExStyle | [optional] erweiterte Stile des Controls |
Rückgabewert
| Erfolg: | Handle des Animations-Controls |
| Fehler: | 0 |
Bemerkungen
Diese Funktion ist für erfahrene Benutzer und zum erlernen der Funktion von Controls.
Verwandte Funktionen
_GUICtrlAVI_Destroy
Beispiel
#include <GuiConstantsEx.au3>
#include <GuiAVI.au3>
#include <WindowsConstants.au3>
Opt('MustDeclareVars', 1)
$Debug_AVI = False ; Prüft den Klassennamen (ClassName), der an die AVI-Funktion übergeben wird. Setze dies versuchsweise auf True und verwende dann ein Handle zu einem anderen Control, um die Funktionsweise zu verstehen.
Global $hAVI
_Beispiel1()
_Beispiel2()
Func _Beispiel1()
Local $Wow64 = ""
If @AutoItX64 Then $Wow64 = "\Wow6432Node"
Local $hGUI, $sFile = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE" & $Wow64 & "\AutoIt v3\AutoIt", "InstallDir") & "\Examples\GUI\SampleAVI.avi"
; Erstellt eine GUI
$hGUI = GUICreate("AVI: Erstellen (Extern 1)", 300, 100)
$hAVI = _GUICtrlAVI_Create($hGUI, $sFile, -1, 10, 10)
GUISetState()
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
; Spielt das AutoIt Beispiel-AVI ab
_GUICtrlAVI_Play($hAVI)
; Die Schleife wiederholt sich, bis der Benutzer die Beenden-Aktion der GUI auslöst
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
; Schließt AVI-Clip und GUI
_GUICtrlAVI_Close($hAVI)
GUIDelete()
EndFunc ;==>_Beispiel1
Func _Beispiel2()
Local $hGUI
; Erstellt eine GUI
$hGUI = GUICreate("AVI: Erstellen (Extern 2)", 300, 100)
$hAVI = _GUICtrlAVI_Create($hGUI, @SystemDir & "\Shell32.dll", 150, 10, 10)
GUISetState()
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
; Spielt das AutoIt Beispiel-AVI ab
_GUICtrlAVI_Play($hAVI)
; Die Schleife wiederholt sich, bis der Benutzer eine Beenden-Aktion auslöst
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
; Schließt AVI-Clip und GUI
_GUICtrlAVI_Close($hAVI)
GUIDelete()
EndFunc ;==>_Beispiel2
Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
Local $hWndFrom, $iIDFrom, $iCode
$hWndFrom = $ilParam
$iIDFrom = BitAND($iwParam, 0xFFFF) ; Low Word
$iCode = BitShift($iwParam, 16) ; Hi Word
Switch $hWndFrom
Case $hAVI
Switch $iCode
Case $ACN_START ; Benachrichtigt das Parent-Fenster eines AnimationsControls, dass der verknüpfte AVI-Clip gestartet wurde
_DebugPrint("$ACN_START" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; Kein Rückgabewert
Case $ACN_STOP ; Benachrichtigt das Parent Fenster eines AnimationsControls, dass der verknüpfte AVI-Clip gestoppt wurde
_DebugPrint("$ACN_STOP" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode)
; Kein Rückgabewert
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_COMMAND
Func _DebugPrint($s_text, $line = @ScriptLineNumber)
ConsoleWrite( _
"!===========================================================" & @LF & _
"+======================================================" & @LF & _
"-->Zeile(" & StringFormat("%04d", $line) & "):" & @TAB & $s_text & @LF & _
"+======================================================" & @LF)
EndFunc ;==>_DebugPrint