Champak Posted June 25, 2008 Share Posted June 25, 2008 I need some help with an object event. This is what I've tried, and a few other things, but I just can't get it.ObjEvent ( $oDVD2, "DVDf_") Func DVDf_DVDNotify("EC_DVD_DISC_EJECTED",0,0) MsgBox(0,0,0) EndFuncI'm trying to get the following eventsEC_DVD_DISC_EJECTEDEC_DVD_DISC_INSERTEDEC_DVD_STILL_OFFEC_DVD_STILL_ONHere is a link to the info from msdnhttp://msdn.microsoft.com/en-us/library/ms783428(VS.85).aspxThanks Link to comment Share on other sites More sharing options...
weaponx Posted June 25, 2008 Share Posted June 25, 2008 Triple topic creation...? Link to comment Share on other sites More sharing options...
Champak Posted June 25, 2008 Author Share Posted June 25, 2008 Slow forum. Link to comment Share on other sites More sharing options...
Champak Posted June 30, 2008 Author Share Posted June 30, 2008 OK, I see that besides my basic syntax being wrong, msdn is saying that I need to set this up with something else. So corrected code should look like:;$oDVD2 is the object ObjEvent ( $oDVD2, "DVDf_") Func DVDf_DVDNotify($aa, $bb, $cc) If $aa = "EC_DVD_DISC_EJECTED" then MsgBox(0,0,0) EndFuncBut according to msdn http://msdn.microsoft.com/en-us/library/ms787383(VS.85).aspx , I need to declare the object using "WithEvents". How do I do that? Link to comment Share on other sites More sharing options...
Champak Posted July 31, 2008 Author Share Posted July 31, 2008 (edited) bump still trying to fiGure out the "WithEvents" issue with this...anyone? Here is something more to look at if that is needed. Only some of the notifications are showing...up until the movie actually starts, which is where I suspect the "WithEvents" comes into play. $oDVD1 = ObjCreate("MSVidCtl.MSVidCtl.1") $oDVD2 = ObjCreate("MSVidCtl.MSVidWebDVD.1") If Not (IsObj($oDVD1) Or IsObj($oDVD2)) Then MsgBox(262144+48,"Error","Failed to activate DVD ." & @CRLF & "DVD player will be unable to play DVDs.") EndIf $VideoGUI = GUICreate("", @DesktopWidth/2, @DesktopHeight/2) GUISetBkColor(0x000000) $VideoObject = GUICtrlCreateObj($oDVD1, 0, 0, @DesktopWidth/2, @DesktopHeight/2) $oDVD1.View ("DVD:") $oDVD1.Build $oDVD2 = $oDVD1.InputActive $oDVD3 = $oDVD2.DVDAdm $oDVD2.DVDDirectory = "E:\\VIDEO_TS" $oDVD1.Run GUISetState(@SW_SHOW) ObjEvent($oDVD2, "DVDf_") While 1 Sleep(60) WEnd Func DVDf_DVDNotify($a, $b, $c) ConsoleWrite("!Event 1 " & $a & @CRLF) ConsoleWrite("!Event 2 " & $b & @CRLF) ConsoleWrite("!Event 3 " & $c & @CRLF) ; If $aa = "282" then ConsoleWrite("Domain Change" & @CRLF) EndFunc Edited July 31, 2008 by Champak Link to comment Share on other sites More sharing options...
Champak Posted October 28, 2008 Author Share Posted October 28, 2008 (edited) I'm asking one last time, does anyone know if "WithEvents" has any specific implications in translating to AutoIt? Edited October 28, 2008 by Champak Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now