Jump to content
Sign in to follow this  
JuniorCoder

gui embedded wmp load new media

Recommended Posts

Right off the bat the au3check complains about 2 lines:

239 and 256 and for obvious reasons:

$Sound_folder&$Sound_file

$Video_folder&$Video_file

;I can only assume it should be

$SFX = $Sound_folder&$Sound_file

$Avi = $Video_folder&$Video_file

 

Statement cannot be just an expression.

 

Edited by careca

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By CYCho
      Hi there! I wish every one of you to be healthy and happy.
      I made the following code borrowing mainly from @dragan's post.
       
      #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> Global $mainGUI = GUICreate("Load and play a video file", 400, 200, -1, -1) Global $inputFile = GUICtrlCreateInput("", 20, 50, 280, 20) Global $btnLoad = GUICtrlCreateButton("Load", 300, 48, 80, 23) Global $btnPlay = GUICtrlCreateButton("Play", 160, 100, 80, 23) GUISetState() Global $videoHeight = @DesktopHeight/2, $videoWidth = $videoHeight, $videoLeft = @DesktopWidth-$videoWidth, $IEControl Global $videoGUI = GUICreate("Video Control", $videoWidth, $videoHeight, $videoLeft, 0, $WS_OVERLAPPEDWINDOW) Global $oIE = _GUICtrl_CreateWMPlayer() GUISetState (@SW_HIDE, $videoGUI) GUIRegisterMsg($WM_SIZE, "WM_SIZE") Global $oPlayer = _IEGetObjById($oIE, "objWMPlayer") Global $aMsg While 1 $aMsg = GUIGetMsg(1) If $aMsg[1] = $mainGUI Then If $aMsg[0] = $GUI_EVENT_CLOSE Then Exit ElseIf $aMsg[0] = $btnLoad Then Local $sFile = FileOpenDialog("Open Videos", @UserProfileDir, "Movies (*.3gp;*.mp4;*.avi;*.wmv;*.flv)") GUICtrlSetData($inputFile, $sFile) If @error Then Exit ElseIf $aMsg[0] = $btnPlay Then GUISetState(@SW_SHOW, $videoGUI) $oPlayer.URL = $sFile $oPlayer.Controls.Play While $oPlayer.playState <> 3 Sleep(10) WEnd Local $sWidth = $oPlayer.currentMedia.imageSourceWidth, $sHeight = $oPlayer.currentMedia.imageSourceHeight If $sWidth > 0 Then Local $iWidth = $videoHeight*$sWidth/$sHeight WinMove($videoGUI, "", @DesktopWidth-$iWidth, 0, $iWidth+16, $videoHeight+39) EndIf EndIf ElseIf $aMsg[1] = $videoGUI And $aMsg[0] = $GUI_EVENT_CLOSE Then $oPlayer.Controls.Stop GUISetState (@SW_HIDE, $videoGUI) ContinueLoop ElseIf $oPlayer.playState = 1 Or $oPlayer.playState = 8 Then GUISetState (@SW_HIDE, $videoGUI) ContinueLoop EndIf WEnd Func WM_SIZE($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg, $iwParam, $ilParam Local $xClient, $yClient $xClient = BitAND($ilParam, 0x0000FFFF) $yClient = BitShift($ilParam, 16) GUICtrlSetPos($IEControl, 0, 0, $xClient, $yClient) if NOT @error Then if IsObj($oPlayer) Then $oPlayer.width = $xClient; if IsObj($oPlayer) Then $oPlayer.height = $yClient; EndIf Return $GUI_RUNDEFMSG EndFunc Func _GUICtrl_CreateWMPlayer() Local $myIE_Obj = _IECreateEmbedded () $IEControl = GUICtrlCreateObj($myIE_Obj, 0, 0, $videoWidth, $videoHeight) _IENavigate($myIE_Obj, "about:blank") Local $htmlWMP $htmlWMP = '' _ & @CR & '<body style="margin:0;padding:0" >' _ & @CR & '<OBJECT' _ & @CR & 'ID="objWMPlayer"' _ & @CR & 'STYLE="margin:0;padding:0"' _ & @CR & 'HSPACE="0"' _ & @CR & 'VSPACE="0"' _ & @CR & 'BORDER="0"' _ & @CR & 'WIDTH="' & $videoWidth & '"' _ & @CR & 'HEIGHT="' & $videoHeight & '"' _ & @CR & 'CLASSID="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6"' _ & @CR & 'STANDBY="Loading Windows Media Player components..."' _ & @CR & 'TYPE="application/x-ms-wmp">' _ & @CR & '<PARAM NAME="enableContextMenu" VALUE="true">' _ & @CR & '<PARAM NAME="enableFullScreenControls" VALUE="true">' _ & @CR & '<PARAM NAME="enabled" VALUE="true">' _ & @CR & '<PARAM NAME="playCount" VALUE="1">' _ & @CR & '<PARAM NAME="stretchToFit" VALUE="true">' _ & @CR & '<PARAM NAME="uiMode" VALUE="none">' _ & @CR & '<PARAM NAME="videoBorderWidth" VALUE="5">' _ & @CR & '<PARAM NAME="volume" VALUE="100">' _ & @CR & '<PARAM NAME="windowlessVideo" VALUE="false">' _ & @CR & '</OBJECT>' _ & @CR & '</body>' _IEDocWriteHTML ($myIE_Obj, $htmlWMP) _IEAction ($myIE_Obj, "refresh") $myIE_Obj.document.body.scroll = "no" $myIE_Obj.document.body.style.borderColor = "#000000" Return $myIE_Obj EndFunc ;==>_GUICtrl_CreateWMPlayer This works usually OK, but the embedded WMP behaves abnormally when the 2 windows are minimized and restored depending on which one is minimized and restored first.
      While video is playing:
      1. Minimize $mainGUI, then the $videoGUI becomes blank.
      2. Minimize both and restore $videoGUI first and then the $mainGUI, then the video size in the $videoGUI is changed to it's original source image size.
      Please help me to understand what is the cause of this behaviour and how I can prevent it. Thnaks in advance.
×
×
  • Create New...