Hallo zusammen,
ich hoffe ich in hier richtig. Hab folgendes Problem. Eine Inputbox und ein Fenster welches die restzeit bis zum shutdown anzeigen soll. gebe ich in die inputbox 10 ein startet das label aber bei 12. gebe ich 2 ein startet das label bei 12. also egal was ich eingebe. wer kann helfen ? danke schonmal
HotKeySet("{F5}", "beenden")
[/autoit][autoit][/autoit][autoit]#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:\Users\Baschti\Desktop\shutdown.kxf
$Form1_1 = GUICreate("Shutdown", 229, 212, 261, 210)
$Radio1 = GUICtrlCreateRadio("Herunterfahren", 16, 24, 89, 17)
$Radio2 = GUICtrlCreateRadio("Standby", 16, 48, 89, 17)
$Radio3 = GUICtrlCreateRadio("Abmelden", 16, 72, 89, 17)
$Radio4 = GUICtrlCreateRadio("Strom aus", 16, 96, 89, 17)
$Radio5 = GUICtrlCreateRadio("Schlafmodus", 16, 120, 89, 17)
$Radio6 = GUICtrlCreateRadio("Keine Aktion", 16, 144, 81, 17)
$Group1 = GUICtrlCreateGroup("Aktion", 8, 8, 105, 161)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Start", 8, 176, 99, 25, 0)
$Button2 = GUICtrlCreateButton("Beenden", 120, 176, 99, 25, 0)
$zeit = GUICtrlCreateInput("10", 144, 56, 73, 21)
$Label1 = GUICtrlCreateLabel("Zeit in Minuten", 136, 16, 74, 17)
$Label2 = GUICtrlCreateLabel("bis zum Shutdown", 128, 32, 90, 17)
$Label3 = GUICtrlCreateLabel("Beenden ", 128, 88, 81, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
$Label4 = GUICtrlCreateLabel("=", 152, 104, 13, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Label5 = GUICtrlCreateLabel("F5", 144, 120, 28, 28)
GUICtrlSetFont(-1, 14, 800, 4, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $button1 And BitAND(GUICtrlRead($radio1), $GUI_CHECKED) = $GUI_CHECKED
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Shutdown", 382, 47, 193, 125)
$lblZeit = GUICtrlCreateLabel("00", 0, 0, 42, 41)
GUICtrlSetFont(-1, 25, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
$lblBezeichnung = GUICtrlCreateLabel("Minuten bis Shutdown", 40, 0, 339, 41)
GUICtrlSetFont(-1, 25, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 2
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
; Von unserer Zahl 1 abziehen und wenn wir bei kleiner 0 sind, das Skript beenden
; bzw. eine Andere Aktion durchführen.
$zeit = $zeit - 1
If $zeit < 0 Then
; Hier mache ich nun ein Exit, man könnte natürlich nun auch noch eine
; andere Aktion durchführen.
Exit
EndIf
; Unsere neue Zahl in das Label schreiben, was die verbleibenden Sekunden anzeigt.
GUICtrlSetData($lblZeit, $zeit)
; Pause einfügen, damit wir ungefähr eine Sekunde haben
Sleep(1000)
WEnd
[/autoit][autoit][/autoit][autoit]EndSelect
WEnd
Func beenden()
Exit
EndFunc