#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=AutoItv11.ico #AutoIt3Wrapper_AU3Check_Parameters=-w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;#Include ;#Include #include #include #include #include #include GUICreate("Play vidéo", 300, 130) $ButtonO = GUICtrlCreateButton("Ouvrir vidéo", 5, 5, 135, 25) $ButtonP = GUICtrlCreateButton("Play vidéo", 155, 5, 135, 25) $Label = GUICtrlCreateLabel("", 5, 95, 290, 35) $Group1 = GUICtrlCreateGroup("Quel écran ?", 5, 35, 285, 50) $Radio1 = GUICtrlCreateRadio("Ecran Prinipal", 15, 60, 115, 20) If _Monitor()= "\\.\DISPLAY2" Then $Radio2 = GUICtrlCreateRadio("Ecran Secondaire", 160, 60, 115, 20) GUICtrlSetState( -1, $GUI_CHECKED) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $ButtonO $Open=FileOpenDialog("Open movie", @WorkingDir, "All (*.*)") If Not @error Then $FileToOpen = $Open GUICtrlSetData ( $Label, $FileToOpen) Else $Open="" EndIf Case $msg = $ButtonP If GUICtrlRead($Radio1) = $GUI_CHECKED Then $Mon = 1 Else $Mon = 2 EndIf If $FileToOpen <> "" Then ShellExecute(_SearchPath(),Chr(34)&$Open&Chr(34)&" -f --no-embedded-video --directx-device=" & Chr(34) &_Monitor($Mon)& Chr(34) & " --no-video-title-show") EndSelect WEnd Func _SearchPath() $PathExe = StringSplit(RegRead("HKEY_CLASSES_ROOT\Applications\vlc.exe\shell\Open\command",""),Chr(34)) If $PathExe[0] < 2 Then MsgBox (0, "Error:", "vlc.exe n'est pas installé sur ce PC, Veuilliez (ré-)installer vlc: http://www.videolan.org/") Exit Else Return Chr(34)&$PathExe[2]&Chr(34) EndIf EndFunc Func _Monitor($flag=0) Local $i = 0, $Out, $MaxMon While 1 $aDevice = _WinAPI_EnumDisplayDevices("", $i) If Not $aDevice[0] Or Not StringRegExp ( $aDevice[1], "DISPLAY[12]" , 0 ) Then ExitLoop If BitAND($aDevice[3], 2) = 2 And BitAND($aDevice[3], 1) = 1 Then $MaxMon = "\\.\DISPLAY"&StringRight($aDevice[1],1) If $flag = 1 then $Out = $MaxMon ExitLoop EndIf ElseIf BitAND($aDevice[3], 1) = 1 Then $MaxMon= "\\.\DISPLAY"&StringRight($aDevice[1],1) If $flag = 2 then $Out = $MaxMon EndIf Else $Out = $MaxMon EndIf $i += 1 WEnd If $flag = 0 Then $Out = $MaxMon Return $Out EndFunc