Hallo Leute , ich habe mal wieder ein Problem.
Dazu habe ich wieder ein Beispielscript erstellt, welches mein Problem schildern soll.
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
[/autoit] [autoit][/autoit] [autoit]Global $WMP , $Button2 , $channel = "http://blackbeats.fm/listen.asx" , $Label
[/autoit] [autoit][/autoit] [autoit]$Form1 = GUICreate("Loop-Stop", 247, 109, 426, 173)
GUISetOnEvent(-3, "_Exit")
$WMP = ObjCreate("WMPlayer.OCX")
$Button1 = GUICtrlCreateButton("Play", 24, 56, 81, 41, 0)
GUICtrlSetOnEvent(-1,"_play")
$Button2 = GUICtrlCreateButton("Stop", 128, 56, 81, 41, 0)
GUICtrlSetOnEvent(-1,"_stop")
$Label = GUICtrlCreateLabel("Label", 32, 16, 80, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
While Sleep(50)
WEnd
Func _Exit()
Exit
EndFunc
Func _play()
$WMP.URL = $channel
$WMP.controls.play()
GUICtrlSetData($Label,"Loading...")
While $WMP.playstate <> 3
;Falls stop geklickt , soll _stop() aufgerufen werden
Sleep(20)
WEnd
GUICtrlSetData($Label,"Playing")
EndFunc
Func _stop()
$WMP.controls.stop()
GUICtrlSetData($Label,"Stopped")
EndFunc
Wie kann ich eine Schleife nach einem Klick auf einen Button sofort verlassen ? Wie würdet ihr das machen?
Am besten ohne GuiGetMsg() , wenn , dann mit GuiGetCursorInfo().