Danke für die Tips. Ich habe versucht sie umzusetzen. Wie ich die GUIs mit den Befehlen aus und einblenden unterscheiden kann verstehe ich aber nicht. Micha_he: vlt kannst du mir da noch einen weiteren Tip geben
Nun also noch einmal das angepasste Skript
C
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Global $Counter
Global $Limit = 3
Global $Button1
While 2
_Auftrag_Starten()
$Counter =0
Beep ( 500, 200)
ConsoleWrite("---------------the current number is:"&$Counter&"----------------------------"&@CRLF) ;~ programm check
While 1
Sleep(2000)
ConsoleWrite("---------------the current hour is:"&@HOUR&"----------------------------"&@CRLF) ;~ programm check
$Date1 = @YEAR&":"&@MON&":"&@MDAY ;~ setting variable $Date1 [yyyymmdd]
$StartTime1 = @HOUR*3600+@MIN*60+@SEC ;~ setting variable $StartTime1 [hhmmss
$Counter+=1
ConsoleWrite("---------------the current number is:"&$Counter&"----------------------------"&@CRLF) ;~ programm check
If $Limit=$Counter Then
_Auftrag_Fertig()
EndIf
If $Button1 Then
ExitLoop
EndIf
WEnd
WEnd
Func _Auftrag_Starten()
#Region ### START Koda GUI section ### Form=D:\detrauti\Desktop\FAUF-Fertig.kxf
$Form1 = GUICreate("Form2", 615, 438, 192, 124)
$TextBox1_1 = GUICtrlCreateLabel("neuer Auftrag Starten", 64, 48, 380, 49)
GUICtrlSetFont(-1, 30, 400, 0, "Arial")
$Button1Start = GUICtrlCreateButton("Start", 144, 216, 145, 97)
GUICtrlSetFont(-1, 30, 800, 0, "Arial Narrow")
$TextBox1_2 = GUICtrlCreateLabel("Bereit?", 68, 144, 129, 49)
GUICtrlSetFont(-1, 30, 400, 0, "Arial")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1Start
GUISetState(@SW_HIDE)
ExitLoop
EndSwitch
WEnd
EndFunc
Func _Auftrag_Fertig()
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Form1", 500, 300, 469, 41, BitOR($WS_SYSMENU,$WS_POPUP))
$TextBox2_1 = GUICtrlCreateLabel("Stückzahl erreicht", 64, 48, 316, 49)
GUICtrlSetFont(-1, 30, 400, 0, "Arial")
$Button1 = GUICtrlCreateButton("JA", 144, 216, 145, 97)
GUICtrlSetFont(-1, 30, 800, 0, "Arial Narrow")
$TextBox2_2 = GUICtrlCreateLabel("Arbeitsauftrag fertig?", 68, 144, 370, 49)
GUICtrlSetFont(-1, 30, 400, 0, "Arial")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
GUISetState(@SW_HIDE)
ExitLoop
EndSwitch
WEnd
EndFunc
Alles anzeigen