ConsultingJoe Posted June 7, 2006 Posted June 7, 2006 (edited) This could look the same as if you were to embed a video in a website. It embeds WMP into a gui, This is beta. the example should help a lot Let me know what you think Thanks UPDATED ON 09/06/07 WITH MORE FUNCTIONS #include <GUIConstants.au3> #include <wmp.au3> Opt("GUIOnEventMode", 1) $Form1 = GUICreate("AForm1", 518, 439, 192, 125) GUISetOnEvent($GUI_EVENT_CLOSE, "quit") $wmp = _wmpcreate(1, 8, 8, 425, 425);creates object _wmpvalue( $wmp, "nocontrols" );hides controls _wmploadmedia( $wmp, @HomeDrive & "\WINDOWS\clock.avi" );loads media ;_wmpsetvalue( $wmp, "controls" );shows controls $slider = GUICtrlCreateSlider( 4, 330, 330, 25 ) GUICtrlSetOnEvent( -1, "change" ) GUISetState(@SW_SHOW) While _wmpvalue($wmp,"getduration") = 0 Sleep(1) WEnd GUICtrlSetLimit($slider,_wmpvalue($wmp,"getduration"),0) GUISetState(@SW_SHOW) While 1 Sleep(100) GUICtrlSetData( $slider, _wmpvalue($wmp,"getposition")) WEnd Func quit() Exit EndFunc Func change() _wmpvalue($wmp,"setposition",GUICtrlRead($slider)) EndFunc expandcollapse popup#cs _wmpcreate($show, $left, $top, $width = 100, $height = 100) $show: 1 = shows controls 2 = hides controls Return: The object for the control #ce Func _wmpcreate($show, $left, $top, $width = 100, $height = 100) $oWMP = ObjCreate("WMPlayer.OCX") If $oWMP = 0 Then Return 0 $oWMP.settings.autoStart = "False" If $show = 1 Then GUICtrlCreateObj($oWMP, $left, $top, $width, $height) EndIf Return $oWMP EndFunc #cs _wmploadmedia( $object, $URL, $autostart = 1 ) $object: Object returned from the _wmpcreate() $URL: Path or URL of the media $autostart: 1 = yes 0 = no Return: None #ce Func _wmploadmedia( $object, $URL, $autostart = 1 ) $object.URL = $URL While Not $object.controls.isAvailable("play") Sleep(1) WEnd If $autostart = 1 Then $object.controls.play() EndFunc #cs _wmpsetvalue( $object, $setting, $para=1 ) $object: Object returned from the _wmpcreate() $setting: "play" "stop" "pause" "invisible" (Hides all) "control" (Shows controls) "nocontrol" (Hides controls) "fullscreen" "step" (frames to step before freezing) "fastforward" "fastreverse" "volume" (0 To 100) "rate" (-10 To 10) "playcount" Return: None #ce Func _wmpvalue( $object, $setting, $para=1 ) Select Case $setting = "play" If $object.controls.isAvailable("play") Then $object.controls.play() Case $setting = "stop" If $object.controls.isAvailable("stop") Then $object.controls.stop() Case $setting = "pause" If $object.controls.isAvailable("pause") Then $object.controls.pause() Case $setting = "invisible" $object.uiMode = "invisible" Case $setting = "controls" $object.uiMode = "mini" Case $setting = "nocontrols" $object.uiMode = "none" Case $setting = "fullscreen" $object.fullscreen = "true" Case $setting = "step" If $object.controls.isAvailable("step") Then $object.controls.step($para) Case $setting = "fastForward" If $object.controls.isAvailable("fastForward") Then $object.controls.fastForward() Case $setting = "fastReverse" If $object.controls.isAvailable("fastReverse") Then $object.controls.fastReverse() Case $setting = "volume" $object.settings.volume = $para Case $setting = "rate" $object.settings.rate = $para Case $setting = "playcount" $object.settings.playCount = $para Case $setting = "setposition" $object.controls.currentPosition = $para Case $setting = "getposition" Return $object.controls.currentPosition Case $setting = "getpositionstring";Returns HH:MM:SS Return $object.controls.currentPositionString Case $setting = "getduration" Return $object.currentMedia.duration EndSelect EndFunc Edited September 6, 2007 by CyberZeroCool Check out ConsultingJoe.com
ConsultingJoe Posted June 8, 2006 Author Posted June 8, 2006 this is nice Thanks, its way better than my embeder that used IE to write and embed a web page Check out ConsultingJoe.com
ptrex Posted June 8, 2006 Posted June 8, 2006 very nice I like COM objects a lot and this one is a nice addition. Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
J_Y_C Posted August 9, 2006 Posted August 9, 2006 Ummm, am I daft or is there no link to a WMP UDF anywhere in this thread.....
RazerM Posted August 9, 2006 Posted August 9, 2006 I want to see this also, could you post the script again please? My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
WTS Posted August 9, 2006 Posted August 9, 2006 (edited) I want to see this also, could you post the script again please? it mysteriously disapeared? I think this is it.. WMP.au3 expandcollapse popup#cs _wmpcreate($show, $left, $top, $width = 100, $height = 100) $show: 1 = shows controls 2 = hides controls Return: The object for the control #ce Func _wmpcreate($show, $left, $top, $width = 100, $height = 100) $oWMP = ObjCreate("WMPlayer.OCX") If $oWMP = 0 Then Return 0 $oWMP.settings.autoStart = "False" If $show = 1 Then GUICtrlCreateObj($oWMP, $left, $top, $width, $height) EndIf Return $oWMP EndFunc #cs _wmploadmedia( $object, $URL, $autostart = 1 ) $object: Object returned from the _wmpcreate() $URL: Path or URL of the media $autostart: 1 = yes 0 = no Return: None #ce Func _wmploadmedia( $object, $URL, $autostart = 1 ) $object.URL = $URL If $autostart = 1 And $object.controls.isAvailable("play") Then $object.controls.play() EndFunc #cs _wmpsetvalue( $object, $setting, $para=1 ) $object: Object returned from the _wmpcreate() $setting: "play" "stop" "pause" "invisible" (Hides all) "control" (Shows controls) "nocontrol" (Hides controls) "fullscreen" "step" (frames to step before freezing) "fastforward" "fastreverse" "volume" (0 To 100) "rate" (-10 To 10) "playcount" Return: None #ce Func _wmpsetvalue( $object, $setting, $para=1 ) Select Case $setting = "play" If $object.controls.isAvailable("play") Then $object.controls.play() Case $setting = "stop" If $object.controls.isAvailable("stop") Then $object.controls.stop() Case $setting = "pause" If $object.controls.isAvailable("pause") Then $object.controls.pause() Case $setting = "invisible" $object.uiMode = "invisible" Case $setting = "controls" $object.uiMode = "mini" Case $setting = "nocontrols" $object.uiMode = "none" Case $setting = "fullscreen" $object.fullscreen = "true" Case $setting = "step" If $object.controls.isAvailable("step") Then $object.controls.step($para) Case $setting = "fastForward" If $object.controls.isAvailable("fastForward") Then $object.controls.fastForward() Case $setting = "fastReverse" If $object.controls.isAvailable("fastReverse") Then $object.controls.fastReverse() Case $setting = "volume" $object.settings.volume = $para Case $setting = "rate" $object.settings.rate = $para Case $setting = "playcount" $object.settings.playCount = $para EndSelect EndFunc WMP_Example.au3 #include <GUIConstants.au3> #include <wmp.au3> ; == GUI generated with Koda == $Form1 = GUICreate("AForm1", 518, 439, 192, 125) $wmp = _wmpcreate(1, 8, 8, 425, 425);creates object _wmpsetvalue( $wmp, "nocontrols" );hides controls GUISetState(@SW_SHOW) _wmploadmedia( $wmp, @HomeDrive & "\WINDOWS\clock.avi" );loads media ;Sleep(1000) ;_wmpsetvalue( $wmp, "controls" );shows controls While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;;;;;; EndSelect WEnd Exit Edited August 9, 2006 by WTS
RazerM Posted August 9, 2006 Posted August 9, 2006 Thanks My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
ConsultingJoe Posted August 13, 2006 Author Posted August 13, 2006 Thanks, I dono what happend Check out ConsultingJoe.com
Wus Posted August 14, 2006 Posted August 14, 2006 Nice, I will use it to hotkey WMP from games and such.
BananaFredSoft Posted July 23, 2007 Posted July 23, 2007 (edited) When I try play an AVI video with this, it plays the audio but doesn't show the video, just a black square. Here is my code: $display = _wmpcreate(1, 181, 10, 280, 210) _wmploadmedia($display, $readfrom, 0) _wmpsetvalue($display, "control") By the way, the functions are really good! Thanks! Edited July 23, 2007 by BananaFredSoft -ColinSite:www.bananafredsoft.comStuff:Simple Text Editor - MediaPlayer - Animator - BananaDB - BananaNotes - Chatta - Filesearch - Excuse GeneratorMy YouTube channel:http://www.youtube.com/user/colipat
Trasy Posted July 23, 2007 Posted July 23, 2007 When I try play an AVI video with this, it plays the audio but doesn't show the video, just a black square. Here is my code: $display = _wmpcreate(1, 181, 10, 280, 210) _wmploadmedia($display, $readfrom, 0) _wmpsetvalue($display, "control") By the way, the functions are really good! Thanks! Be sure $readfrom is a valid path and __wmpsetvalue($display, "control") is false, it's _wmpsetvalue($display, "controls").
Tam0r Posted July 27, 2007 Posted July 27, 2007 http://msdn2.microsoft.com/en-us/library/bb249349.aspxCan't one use these objects?
ConsultingJoe Posted August 31, 2007 Author Posted August 31, 2007 http://msdn2.microsoft.com/en-us/library/bb249349.aspxCan't one use these objects?yeah, go for it Check out ConsultingJoe.com
ConsultingJoe Posted August 31, 2007 Author Posted August 31, 2007 TO ALL: UPDATE YOUR MEDIA PLAYER Goto help and click check for update. Check out ConsultingJoe.com
ConsultingJoe Posted August 31, 2007 Author Posted August 31, 2007 Why? It only works with Wmp 11?no, it should work with 9 and 10 too. but some functions maybe limited. Check out ConsultingJoe.com
mnchartier Posted September 6, 2007 Posted September 6, 2007 This looks very good. I did notice that you can not use the slider though to select where you want to listen from or go back to. Is there anyway to get that to work otherwise this is sweet.
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