Hallo AutoIt Community,
Ich habe ein Problem mit einem Script. Genau genommen wollte ich im Hintergrund einer GUI ein Video-loop laufen lassen. Das Funktioniert auch sehr gut, nur jetzt würde ich gerne Buttons, Labels etc... hinzufügen.
Leider geht das nicht so einfach wie ich mir das vorgestellt habe, wenn man die VIDEO-GUI bewegt bleibt die Child GUI mit den Buttons und Labels am selben fleck.
#include <ie.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <gdiplus.au3>
#include <Misc.au3>
#include <file.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <sound.au3>
#include <Array.au3>
Global $a_Array, $a_Split, $a_Msg[2]
[/autoit][autoit][/autoit][autoit]SoundSetWaveVolume(40)
[/autoit][autoit][/autoit][autoit]Global $GUI_INFO_BOX = ""
Global $GUI_State = 0
HotKeySet("{esc}", "_exit")
[/autoit][autoit][/autoit][autoit]$content = "" & _
'<html><body style="margin:0;padding:0;border:0" bgcolor="black">' & @CRLF & _
'<OBJECT' & @CRLF & _
'ID="objWMPlayer"' & @CRLF & _
'STYLE="margin:0;padding:0; top: 0px; left: 0px; position: absolute;"' & @CRLF & _
'HSPACE="0"' & @CRLF & _
'VSPACE="0"' & @CRLF & _
'BORDER="0"' & @CRLF & _
'WIDTH="100%"' & @CRLF & _
'HEIGHT="100%"' & @CRLF & _
'CLASSID="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6"' & @CRLF & _
'STANDBY="Loading Windows Media Player components..."' & @CRLF & _
'TYPE="application/x-oleobject">' & @CRLF & _
'<PARAM NAME="allowHideControls" VALUE="true">' & @CRLF & _
'<PARAM NAME="autoStart" VALUE="true">' & @CRLF & _
'<PARAM NAME="audioStream" VALUE="false">' & @CRLF & _
'<PARAM NAME="autoSize" VALUE="true">' & @CRLF & _
'<PARAM NAME="balance" VALUE="0"><!-- -100 to 100 -->' & @CRLF & _
'<!-- <PARAM NAME="bufferingTime" VALUE="5"><!-- seconds -->' & @CRLF & _
'<PARAM NAME="clickToPlay" VALUE="false"><!-- has no effect -->' & @CRLF & _
'<PARAM NAME="currentPosition" VALUE="0"><!-- start position within video, in seconds -->' & @CRLF & _
'<PARAM NAME="enableContextMenu" VALUE="true">' & @CRLF & _
'<PARAM NAME="enableFullScreenControls" VALUE="True">' & @CRLF & _
'<PARAM NAME="enabled" VALUE="true"><!-- whether controls are enabled -->' & @CRLF & _
'<PARAM NAME="fullScreen" VALUE="False">' & @CRLF & _
'<PARAM NAME="mute" VALUE="false">' & @CRLF & _
'<PARAM NAME="playCount" VALUE="999">' & @CRLF & _
'<!-- <PARAM NAME="previewMode" VALUE="true"> -->' & @CRLF & _
'<PARAM NAME="rate" VALUE="1"><!-- play speed of -.5 to 2 increments of .1 -->' & @CRLF & _
'<PARAM NAME="sendPlayStateChangeEvents" VALUE="false">' & @CRLF & _
'<PARAM NAME="showCaptioning" VALUE="false">' & @CRLF & _
'<PARAM NAME="showControls" VALUE="true">' & @CRLF & _
'<PARAM NAME="showGotoBar" VALUE="false">' & @CRLF & _
'<PARAM NAME="showPositionControls" VALUE="true"><!-- uiMode must = "full" -->' & @CRLF & _
'<PARAM NAME="showStatusBar" VALUE="false"><!-- has no effect -->' & @CRLF & _
'<PARAM NAME="showDisplay" VALUE="true"><!-- has no effect - reportedly shows filename -->' & @CRLF & _
'<PARAM NAME="stretchToFit" VALUE="true">' & @CRLF & _
'<PARAM NAME="uiMode" VALUE="none"><!-- invisible, none, mini, full -->' & @CRLF & _
'<PARAM NAME="url" VALUE="' & @ScriptDir & '\GUI\background.wmv">' & @CRLF & _
'<!-- <PARAM NAME="videoBorderWidth" VALUE="0"> -->' & @CRLF & _
'<PARAM NAME="volume" VALUE="0"><!-- volume percent setting of wmplayer.exe -->' & @CRLF & _
'<PARAM NAME="windowlessVideo" VALUE="false"><!-- must be the default (false) for function to work in wmp 9.0, otherwise might renders video directly in the client area -->' & @CRLF & _
'</OBJECT>' & @CRLF & _
'</body></html>'
$GUI_vid = GUICreate("", 676, 562)
[/autoit][autoit][/autoit][autoit][/autoit][autoit]$oIE = _IECreateEmbedded()
If 676 * 0.625 > 562 Then
GUICtrlCreateObj($oIE, 0, 0, 676, 562 * 0.625)
GUICtrlSetState(-1,$GUI_DISABLE)
Else
GUICtrlCreateObj($oIE, -1 * (676 * 1.6 - 676) / 2, 0, 562 * 1.6, 562)
GUICtrlSetState(-1,$GUI_DISABLE)
EndIf
_IENavigate($oIE, 'about:blank')
_IEDocWriteHTML($oIE, $content)
_IEAction($oIE, "refresh")
$oIE.document.body.scroll = "no"
$oIE.document.body.style.overflow = "hidden"
GUISetState()
$tSize = DllStructCreate($tagSIZE)
$pSize = DllStructGetPtr($tSize)
DllStructSetData($tSize, "X", 676)
DllStructSetData($tSize, "Y", 562 )
$tSource = DllStructCreate($tagPOINT)
$pSource = DllStructGetPtr($tSource)
$tBlend = DllStructCreate($tagBLENDFUNCTION)
$pBlend = DllStructGetPtr($tBlend)
DllStructSetData($tBlend, "Alpha", 255)
DllStructSetData($tBlend, "Format", 1)
$tPoint = DllStructCreate($tagPOINT)
$pPoint = DllStructGetPtr($tPoint)
DllStructSetData($tPoint, "X", 0)
DllStructSetData($tPoint, "Y", 0)
$GUI_over = GUICreate("", 676, 562, 0, 0,$WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
$Button1 = GUICtrlCreateButton("Button1", 10, 10, 75, 25)
GUISetState(@SW_SHOW,$GUI_over)
$combined_rgn = _WinAPI_CreateRectRgn(0, 0, 0, 0)
_AddCtrlRegion($combined_rgn, $Button1)
_WinAPI_SetWindowRgn($GUI_over, $combined_rgn)
While 1
Sleep(100)
WEnd
[/autoit][autoit][/autoit][autoit]Func _AddCtrlRegion($full_rgn, $ctrl_id)
Local $ctrl_pos, $ctrl_rgn
$ctrl_pos = ControlGetPos($GUI_over, "", $ctrl_id)
$ctrl_rgn = _WinAPI_CreateRectRgn($ctrl_pos[0], $ctrl_pos[1], $ctrl_pos[0] + $ctrl_pos[2], $ctrl_pos[1] + $ctrl_pos[3])
_WinAPI_CombineRgn($full_rgn, $full_rgn, $ctrl_rgn, $RGN_OR)
_WinAPI_DeleteObject($ctrl_rgn)
EndFunc ;==>_AddCtrlRegion
Func _Exit()
Exit
EndFunc ;==>_Exit
Wäre nett wenn mir jemand helfen könnte.
grüße
derBrot