Sign in to follow this  
Followers 0
dantay9

embeded object

4 posts in this topic

#1 ·  Posted (edited)

I have IE embeded into a window so I can play the matrix as the background for my gui. I have it working, except I can't get the context menu on the windows media player to go away. Also, why can't I click on the button that I made after the object and whenever I move the window, the button disappears. Why???

#include <IE.au3>
 #include <WindowsConstants.au3>
 #include <GuiConstantsEx.au3>
 
 Global $oIE = _IECreateEmbedded()
 $s_PlayerObjId = "wmplayerID"
 
;~ $videoPath = FileOpenDialog("Choose a video file", @MyDocumentsDir, "Videos (*.avi;*.mpeg;*.mpg;*.wmv)", 3)
 
 $gui = GUICreate("", 600, 450)
 GUISetState()
 
 $o_Plyr = playVideo($oIE, "wmplayerID", @DesktopDir & "\dreamscene-matrix.wmv", -32, -50, 800, 550)
 Sleep(1500)
 
 $pos = WinGetClientSize($gui)
 $w = $pos[0]
 $h = $pos[1]
 $Test = GUICtrlCreateButton("Test", 50, 50, 150, 50)
 While 1
     $msg = GUIGetMsg()
     Switch $msg
         Case $GUI_EVENT_CLOSE
             ExitLoop
         Case $Test
             MsgBox(0, '', "Test")
     EndSwitch
     Sleep(10)
 WEnd
 $oIE = 0
 
 Func playVideo(ByRef $oIE, $s_PlayerObjId, $vid, $i_Left, $i_Top, $i_Width, $i_Height)
 
     Local $blank, $oDoc, $oBody, $oBodyStyle, $IEReadyState, $o_Plyr
     $oCtrl = GUICtrlCreateObj($oIE, $i_Left, $i_Top, $i_Width, $i_Height)
     _IENavigate($oIE, "about:blank", 1)
     _IELoadWait($oIE, 180, 4000)
     Do
         Sleep(50)
         $oDoc = $oIE.document
     Until IsObj($oDoc)
     Sleep(25)
 
     $oBody = $oDoc.body
     $oBody.scroll = "no"
     $oBodyStyle = $oBody.style
     $oBodyStyle.margin = "0px"
     $oBodyStyle.border = "0px"
     $oBodyStyle.padding = "0px"
     $oBodyStyle.background = "#000000"
     $o_Plyr = $oDoc.createElement("OBJECT")
     With $o_Plyr
         .id = $s_PlayerObjId
         .style.margin = "0px"
         .style.border = "0px"
         .style.padding = "0px"
         .style.width = $i_Width
         .style.height = $i_Height
;~       .enableContextMenu = "false"; Isn't this how to stop context menu???
         .classid = "CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
         .uiMode = "none"; invisible, none, mini, full
         .StretchToFit = True
         .settings.setMode("loop", "true")
         .settings.rate = 1
         .URL = $vid
     EndWith
     $oBody.appendChild($o_Plyr)
     Return $o_Plyr
 EndFunc ;==>playVideo
Edited by dantay9

[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites



*BUMP*

Is anyone confused about what I want?


[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites

You can use WMPlayer.OCX.7 which is available to WMP10 and up, I think. It exposes quite the same functionality, including the .EnableContextMenu , .uiMode, .Settings, etc.. but I don't see how it'll be possible to use it as the background of your GUI to put controls on it.

Share this post


Link to post
Share on other sites

Thanks for your reply. I didn't think it was really possible either. Thanks for confirming that.


[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0