moin
ich arbeite im moment an einem modifiziertem shutdown manager
(nicht schon wieder so einer^^)
naja jedenfalls muss der halt bombenmäßig viele einstellungen haben und das kam bei raus:
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <ListBoxConstants.au3>
$Form1 = GUICreate("C.S.F. -Tool", 410, 500)
$Start = GUICtrlCreateButton("Start", 152, 448, 75, 25, $WS_GROUP)
$inputhour = GUICtrlCreateInput("00", 10, 42, 75, 60, @SW_DISABLE)
GUICtrlSetFont(-1, 30, 400, 0, "Sylfaen")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0x000000)
$updownhour = GUICtrlCreateUpdown($inputhour)
GUICtrlSetLimit($updownhour, 23)
$inputmin = GUICtrlCreateInput("00", 10, 100, 75, 60, @SW_DISABLE)
GUICtrlSetFont(-1, 30, 400, 0, "Sylfaen")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0x000000)
$updownmin = GUICtrlCreateUpdown($inputmin)
GUICtrlSetLimit($updownmin, 59)
$inputsek = GUICtrlCreateInput("00", 10, 158, 75, 60, @SW_DISABLE)
GUICtrlSetFont(-1, 30, 400, 0, "Sylfaen")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0x000000)
$updownsek = GUICtrlCreateUpdown($inputsek)
GUICtrlSetLimit($updownsek, 59)
$Label1 = GUICtrlCreateLabel("Stunden", 90, 56, 44, 17)
$Label2 = GUICtrlCreateLabel("Minuten", 90, 112, 42, 17)
$Label3 = GUICtrlCreateLabel("Sekunden", 90, 168, 53, 17)
$Radio1 = GUICtrlCreateRadio("Piep-Ton", 224, 40, 113, 17)
$Radio2 = GUICtrlCreateRadio("Eigener Sound", 224, 72, 100, 17)
$Radio3 = GUICtrlCreateRadio("nichts", 224, 104, 113, 17)
GUICtrlSetState($Radio3, $GUI_CHECKED)
$Radio4 = GUICtrlCreateRadio("Programm ausführen", 224, 152, 113, 17)
$Radio5 = GUICtrlCreateRadio("Programm beenden", 224, 192, 113, 17)
$Radio6 = GUICtrlCreateRadio("nichts", 224, 232, 113, 17)
GUISetState($Radio6, $GUI_CHECKED)
$filebutton = GUICtrlCreateButton("Durchsuchen", 328, 72, 75, 25, $WS_GROUP)
$progstart = GUICtrlCreateButton("Durschsuchen", 328, 192, 75, 25, $WS_GROUP)
$progkill = GUICtrlCreateButton("Auswählen", 328, 232, 75, 25, $WS_GROUP)
$Combo1 = GUICtrlCreateCombo("nichts", 224, 320, 145, 25)
GUICtrlSetData($Combo1, "nichts|Herunterfahren|Neu starten|Abmelden|Energie sparen", "nichts")
GUISetState(@SW_SHOW)
[/autoit] [autoit][/autoit] [autoit]While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $filebutton
$soundpath = FileOpenDialog("Sound Datei", @MyDocumentsDir, "*.mp3|*.wav", 3, "", $Form1)
ContinueLoop
Case $progstart
$exepath = FileOpenDialog("Programm auswahl", @MyDocumentsDir, "*.exe", 3, "", $Form1)
ContinueLoop
Case $progkill
Dim $WinList
[/autoit] [autoit][/autoit] [autoit]$Form2 = GUICreate("Programmauswahl", 355, 340, 193, 125)
$List1 = GUICtrlCreateList("", 8, 8, 337, 279)
$button = GUICtrlCreateButton("Auswählen", 140, 300)
GUISetState(@SW_SHOW)
$Liste = _WinListVisible()
For $i = 0 To UBound($Liste) - 1
GUICtrlSetData($List1, $Liste[$i][0])
Next
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $button
$killprog = GUICtrlRead($List1)
GUIDelete()
If $killprog = "" Then _killprogerror()
EndSwitch
WEnd
ContinueLoop
Case $Start
GUISetState(@SW_HIDE)
_count()
EndSwitch
[/autoit] [autoit][/autoit] [autoit]WEnd
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Func _killprogerror()
MsgBox(0, "Fehler", "Du hast nichts ausgewählt")
GUISetState($Radio6, $GUI_CHECKED)
EndFunc
Func _WinListVisible()
Local $WinListVisible[1][2]
Local $Count = 0
$WinList = WinList()
For $i = 1 To $WinList[0][0]
If BitAND(WinGetState($WinList[$i][1]), 2) Then
If $WinList[$i][0] <> "" And $WinList[$i][0] <> "Program Manager" Then
$Count += 1
ReDim $WinListVisible[$Count][2]
$WinListVisible[$Count - 1][0] = $WinList[$i][0]
$WinListVisible[$Count - 1][1] = $WinList[$i][1]
EndIf
EndIf
Next
Return $WinListVisible
EndFunc
Func _count()
[/autoit] [autoit][/autoit] [autoit]$hour = GUICtrlRead($inputhour)
$min = GUICtrlRead($inputmin)
$sek = GUICtrlRead($inputsek)
$time = ($hour * 1120) + ($min * 1060) + ($sek * 1000)
[/autoit] [autoit][/autoit] [autoit]Sleep($time)
[/autoit] [autoit][/autoit] [autoit]EndFunc
[/autoit] [autoit][/autoit] [autoit]$Radio1_r = GUICtrlRead($Radio1)
$Radio2_r = GUICtrlRead($Radio2)
$Radio3_r = GUICtrlRead($Radio3)
While $GUI_CHECKED
Select
Case $Radio1_r
Beep(700, 500)
Beep(700, 500)
Sleep(500)
Beep(700, 500)
Beep(700, 500)
Case $Radio2_r
SoundPlay($soundpath, 1)
Case $Radio3_r
ExitLoop
EndSelect
WEnd
$Radio4_r = GUICtrlRead($Radio4)
$Radio5_r = GUICtrlRead($Radio5)
$Radio6_r = GUICtrlRead($Radio6)
While $GUI_CHECKED
Select
Case $Radio4_r
Run($exepath)
Case $Radio5_r
WinKill($killprog)
Case $Radio6_r
ExitLoop
EndSelect
WEnd
While 1
$combochoice = GUICtrlRead($Combo1)
Select
Case $combochoice = "nichts"
Exit
Case $combochoice = "Herunterfahren"
Shutdown(1)
Case $combochoice = "Neu starten"
Shutdown(2)
Case $combochoice = "Abmelden"
Shutdown(0)
Case $combochoice = "Energie sparen"
Shutdown(32)
EndSelect
WEnd
mein problem ist das wenn ich das script starte wird keine gui geöffnet dadurch kann ich auch nicht testen ob die funktion auch funktionieren ( ich wette 50% davon klappen)
wo ist der fehler? ![]()
mfg bulli