Jump to content

Recommended Posts

Posted

Here's my code:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$PathMp3 = "D:\ENTERTAIMENT\MUSIC\Newest Music\Test.mp3"
$hGUI = GUICreate("Media Player", 1050, 650, 215, 10, Default, Default)
 GUISwitch($hGUI)
 $h_cGUI = GUICreate("Embed Player", 340, 245, 20, 20, $WS_CHILD, -1, $hGUI )
 $oMP = ObjCreate("WMPlayer.OCX")
 $mediaplayer = GUICtrlCreateObj($oMP, 0, -200 , 240, 245)

 GUICtrlCreateTab(1, 1, 900, 300)
 GUICtrlCreateTabItem('TAB 1')
 GUICtrlCreateGroup('TEST', 1, 1, 300, 200)

  GUICtrlCreateTabItem("");

   With $oMP
       .fullScreen = True
       .windowlessVideo = False
       .enableContextMenu = True
       .enabled = True
       .uiMode = "full"
       .settings.autostart = False
       .settings.mute = False
       .settings.volume = 100
       .settings.Balance = 0
       .URL = $PathMp3
   EndWith

   GUISetState(@SW_SHOW, $hGUI)
   GUISetState(@SW_SHOW, $h_cGUI)


   While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
 WEnd

But I dont know how to make windows media appear inside the Group TEST. Could anyone help me????

Posted

What do you mean, just add the GuiCtrlCreateObj after GUICtrlCreateGroup and resize accordingly.  You should also add GUICtrlCreateGroup("", -99, -99, 1, 1) to close the Group control.

Posted
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$PathMp3 = "D:\ENTERTAIMENT\MUSIC\Newest Music\Test.mp3"


 $hGUI = GUICreate("Media Player", 1050, 650, 215, 10, Default, Default)
 GUICtrlCreateTab(1, 1, 900, 300)
 GUICtrlCreateTabItem('TAB 1')
_CreateMediaGuiWithVideo('Test1', $PathMp3, 20, 20)
_CreateMediaGuiWithVideo('Test2', $PathMp3, 300, 20)

    GUICtrlCreateGroup("", -99, -99, 1, 1)
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
 WEnd

Func _CreateMediaGuiWithVideo($String, $PathMp3, $Left, $Top)
    GUICtrlCreateGroup($String, $Left, $Top, 200, 200)
    $h_cGUI = GUICreate("Embed Player", 240, 245, $Left +10, $Top + 10, $WS_CHILD )
    $oMP = ObjCreate("WMPlayer.OCX")
    $mediaplayer = GUICtrlCreateObj($oMP, $Left + 20, $Top + 20 , 240, 245)


   With $oMP
       .fullScreen = True
       .windowlessVideo = False
       .enableContextMenu = True
       .enabled = True
       .uiMode = "mini"
       .settings.autostart = False
       .settings.mute = False
       .settings.volume = 100
       .settings.Balance = 0
       .URL = $PathMp3
   EndWith

   GUISetState(@SW_SHOW, $h_cGUI)
EndFunc

Here's my new code. But how to delete black screen on the media windows.

Posted (edited)

.uiMode = "invisible" - hides the WMP window.

$oMP.controls.play() - plays music

$oMP.controls.pause() - pause music

you can create custom buttons.

Edited by Au3Builder

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...