Ich habe immer Probleme mit dem Befehl sleep Ich denke, dass es daran leigt, dass er simpel den ganzen Script Pausiert, ich hab mir ein paar Forenartikel durchgelesen aber nichts Gutes gefunden. Ich habe gadacht ich hab eine lösung aber es hat auch nicht geholfen Vieleicht wisst ihr warum die GUI nicht reagiert
C
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <audio.au3>
#include <array.au3>
#include <file.au3>
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Playlister", 283, 224, 634, 131)
$Label1 = GUICtrlCreateLabel("", 0, 104, 279, 17)
$Button1 = GUICtrlCreateButton("Offnen:", 48, 40, 75, 25)
$Button2 = GUICtrlCreateButton("Play", 128, 152, 75, 25)
$Pause = GUICtrlCreateButton("Pause", 8, 152, 75, 25)
$Checkbox1 = GUICtrlCreateCheckbox("Ort speichern", 160, 48, 97, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
GUISetState(@SW_SHOW)
GUISetOnEvent($Pause, "_Pause")
GUISetOnEvent($Button2, "_Resume")
GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
GUISetOnEvent($Button1, "_File")
#endregion ### END Koda GUI section ###
$1 = 1
$file = ""
$searchedfile = ""
Func _File()
$file = FileSelectFolder("Ordner auswählen", "", "2")
$firstfile = FileFindFirstFile($file & "\*.*")
$line = "1"
FileFindFirstFile($file & "*.mp3")
$lenght = "0"
$timerinit = TimerInit()
While 1
If TimerDiff($timerinit) > $lenght Then
$searchedfile = FileFindNextFile($firstfile)
Global $CurrentSound = _SoundOpen($file & "\" & $searchedfile)
$lenght = _SoundLength($CurrentSound, 2) + "9000"
_SoundPlay($CurrentSound)
$timerinit = TimerInit()
$name = StringTrimRight($searchedfile, 4)
GUICtrlSetData($Label1, " Gerade wird gespielt: " & $name)
EndIf
WEnd
EndFunc ;==>_File
Func _Pause()
_SoundPause($CurrentSound)
EndFunc ;==>_Pause
Func _Resume()
_SoundResume($CurrentSound)
EndFunc ;==>_Resume
Func _exit()
EndFunc ;==>_exit
While $1 = 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_File()
Case $Pause
_SoundPause($CurrentSound)
Case $Button2
_SoundResume($CurrentSound)
EndSwitch
WEnd
$line = 1
Alles anzeigen