AutoIt Video Converter

01/30/2017 17:25 Hingo#1
Guten Tag Community,
ich habe ein Problem mit meinem Video Converter. Und zwar weiss ich nicht wie den Convert Button programmieren soll, habe dazu auch nichts nützliches im Internet gefunden. Kann mir einer helfen?

Danke schon mal für die Antworten.
MfG
Hingo


#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=Icon.ico
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIConstants.au3>

$widthCell=300


ChooseButton()
Func ChooseButton()
; Create a GUI with various controls.
Local $hGUI = GUICreate("Video Converter", 410, 190)

; Create a button control.
GUICtrlCreateLabel ("Bitte Datei auswählen: ", 20, 10, $widthCell)

GUICtrlCreateLabel ("Bitte Ablageort für konvertierte Datei auswählen: ", 20, 80, $widthCell)

$datei = GUICtrlCreateInput ( "", 20, 35, 300,20)

$ort = GUICtrlCreateInput ("", 20, 100, 300, 20) ; will not accept drag&drop files

$convert = GUICtrlCreateButton ("Convert", 170, 130, 60, 20)

Local $chooseda = GUICtrlCreateButton("Choose", 330, 35, 60, 20)

Local $chooseor = GUICtrlCreateButton("Choose", 330, 100, 60, 20)

Local $idClose = GUICtrlCreateButton("Close", 170, 160, 60, 20)

; Display the GUI.
GUISetState(@SW_SHOW, $hGUI)

Local $iPID = 0
Local $iPID1= 0
Local $iPID2= 0


; Loop until the user exits.
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE, $idClose
ExitLoop

Case $chooseda

$iPID = _openVideoFile()

Case $chooseor

$iPID1 = _FileSelectFolder()

Case $convert

$iPID2 = Convert ()

EndSwitch
WEnd



GUIDelete($hGUI)

; Close the Exlporer process using the PID returned by Run.
If $iPID1 Then ProcessClose($iPID1)


EndFunc


Func _openVideoFile()
; Create a constant variable in Local scope of the message to display in FileOpenDialog.
Local Const $sMessage = "Hold down Ctrl or Shift to choose multiple files."

; Display an open dialog to select a list of file(s).
Local $sFileOpenDialog = FileOpenDialog($sMessage, @WindowsDir & "\", "Videos (*.avi)", $FD_FILEMUSTEXIST + $FD_MULTISELECT)
If @error Then

MsgBox($MB_SYSTEMMODAL, "", "No file(s) were selected.")

; Change the working directory (@WorkingDir) back to the location of the script directory as FileOpenDialog sets it to the last accessed folder.
FileChangeDir(@ScriptDir)
Else
; Change the working directory (@WorkingDir) back to the location of the script directory as FileOpenDialog sets it to the last accessed folder.
FileChangeDir(@ScriptDir)

; Replace instances of "|" with @CRLF in the string returned by FileOpenDialog.
$sFileOpenDialog = StringReplace($sFileOpenDialog, "|", @CRLF)


MsgBox($MB_SYSTEMMODAL, "", "You chose the following files:" & @CRLF & $sFileOpenDialog)
EndIf
EndFunc


;-------------------------------------------------------------------------------------------------------------------------------------------------------------------

Func _FileSelectFolder()

Local Const $sMessage = "Select a folder"


Local $sFileSelectFolder = FileSelectFolder($sMessage, "")
If @error Then

MsgBox($MB_SYSTEMMODAL, "", "No folder was selected.")
Else

MsgBox($MB_SYSTEMMODAL, "", "You choose the following folder:" & @CRLF & $sFileSelectFolder)
EndIf
EndFunc



Convert ()
Func Convert ()



EndFunc[/SIZE][/SIZE][/SIZE][/SIZE][/FONT]