Jump to content
langthang084

WinMedia work on tab

Recommended Posts

langthang084
#include <GuiEdit.au3>
#include <Misc.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <Crypt.au3>
#include <GuiTreeView.au3>

Global $aGCHL_Ctrls[1][1]
Global $iGCHL_MouseHeldDown = 0
$PathData = @ScriptDir & '\Data.txt'

$PathMp3 = @ScriptDir & '\Database\bronch.mp3'

$MAINGUI = GUICreate("PHẦN MỀM HỌC TIẾNG PHỔI", 843, 650, 410, 34)
$TabGeneral = GUICtrlCreateTab(9, 6, 820, 616)
$Tab1 = GUICtrlCreateTabItem("DATABASE")
   $STARTTEST = GUICtrlCreateButton("START", 284, 58, 140, 31)

$Tab2 = GUICtrlCreateTabItem("Compare")
   _CreateMediaGuiWithVideo('Mp3', $PathMp3, 20, 30)

GUICtrlCreateTabItem("")

GUISetState(@SW_SHOW)


While 1
    $Check = GUIGetMsg(1)
    Switch $Check[1]
    Case $MAINGUI
       Switch $Check[0]
       case $GUI_EVENT_CLOSE
          $msg = MsgBox(1, "", "Exit?")
          if $msg = 1 then ExitLoop

      case $STARTTEST
         _CreateMediaGuiWithVideo('ABC', $PathMp3, 30, 50)
      EndSwitch

    EndSwitch
WEnd

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


   With $oMP
       .fullScreen = False
       .windowlessVideo = False
       .enableContextMenu = True
       .enabled = True
       .uiMode = "mini"
       .settings.autostart = False
       .settings.mute = False
       .settings.volume = 100
       .settings.Balance = 0
;~     .settings.playCount = 1000           ;Repeat 1000 lần
       .settings.setMode ("loop", True)     ;Repeat không giới hạn
       .URL = $PathMp3
   EndWith

   GUICtrlCreateGroup("", -99, -99, 1, 1)
   return $MediaGroup
EndFunc

Sorry for my bad English. But there's my code and I have a problem: when press START button (to create the media windows), after that change to COMPARE TAB then the media window still appears on the screen GUI.

Could anyone help resolve it?

Thanks all!

Share this post


Link to post
Share on other sites
Subz

Change the $STARTTEST event to the following

Case $STARTTEST
    GuiSwitch($MAINGUI, $Tab1)
    _CreateMediaGuiWithVideo('ABC', $PathMp3, 30, 50)

 

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

×