hey,
ich habe gerade auf die schnelle ein script geschrieben, was eine macke hat, ich weiss aber nicht warum.
und zwar soll beim ersten start ein gui erscheinen wo man verschiedene einstellungen machen kann. beim klick auf ok wird alles in eine ini gespeichert.
bei den nächsten aufrufen soll nun nur noch alles aus der ini gelesen, und danach die daraus resultierenden angaben ausgeführt werden.
aber das gui schließt sich sofort nach 1 sek immer.
wenn ich aber Select Case zu $cancel und $ok rausnehme, geht es.
nehme ich nur $cancel raus, speichert er sofort die ini. nehme ich $ok raus, poppt das gui wieder nur 1 sek auf.
why ?
Spoiler anzeigen
;
;S.T.A.R.T.E.R_V.1
;
;©
[/autoit] [autoit][/autoit] [autoit];Settings
;#NoTrayIcon
#include<guiconstants.au3>
$ini = "S.T.A.R.T.E.R_Settings.ini"
;if ini exist
If FileExists(@scriptdir & "\" & $ini) Then
call("_run")
[/autoit] [autoit][/autoit] [autoit]Else
$gui = GUICreate("S.T.A.R.T.E.R_V.1 by plutod", 300, 185)
$ok = GUICtrlCreateButton("&OK", 40, 155, 70)
$cancel = GUICtrlCreateButton("&Cancel", 190, 155, 70)
GUICtrlCreateTab(0, 0, 300, 150)
GUICtrlCreateTabItem(" Kill on Start ")
$cbportal = GUICtrlCreateCheckbox("Kill Portal", 30, 40)
$cbinfo = GUICtrlCreateCheckbox("Kill HDINFO", 30, 70)
$cbinstall = GUICtrlCreateCheckbox("Kill Install/Error Msg", 30, 100)
GUICtrlCreateTab(-1, -1, 300, 150)
GUICtrlCreateTabItem(" Run on Start ")
$cbbackup = GUICtrlCreateCheckbox("Run Lotus Notes Backup", 30, 60)
$cbnotes = GUICtrlCreateCheckbox("Run Lotus Notes", 30, 90)
GUICtrlCreateTab(-1, -1, 300, 150)
GUICtrlCreateTabItem("Run on Shutdown")
$cbshutdown = GUICtrlCreateCheckbox("Message before Shutdown", 30, 40)
$editmsg = GUICtrlCreateEdit("Put here your text you want to see before Shutdown", 10, 70, 270, 50)
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
Select
case $msg = $gui_event_close
ExitLoop
Exit
Case $cancel
ExitLoop
Exit
Case $ok
If GUICtrlRead($cbportal) = 1 Then
IniWrite($ini, "Kill on Start", "portal", "1")
Else
IniWrite($ini, "Kill on Start", "portal", "0")
EndIf
If GUICtrlRead($cbinfo) = 1 Then
IniWrite($ini, "Kill on Start", "info", "1")
Else
IniWrite($ini, "Kill on Start", "info", "0")
EndIf
If GUICtrlRead($cbinstall) = 1 Then
IniWrite($ini, "Kill on Start", "install", "1")
Else
IniWrite($ini, "Kill on Start", "install", "0")
EndIf
If GUICtrlRead($cbbackup) = 1 Then
IniWrite($ini, "Run on Start", "backup", "1")
Else
IniWrite($ini, "Run on Start", "backup", "0")
EndIf
If GUICtrlRead($cbnotes) = 1 Then
IniWrite($ini, "Run on Start", "notes", "1")
Else
IniWrite($ini, "Run on Start", "notes", "0")
EndIf
If GUICtrlRead($cbshutdown) = 1 Then
IniWrite($ini, "Run End", "end", "1")
IniWrite($ini, "Run End", "msg", $editmsg)
Else
IniWrite($ini, "Run End", "end", "0")
IniWrite($ini, "Run End", "msg", $editmsg)
EndIf
call("_run")
GUIDelete($gui)
EndSelect
WEnd
EndIf
Func _run()
$portal = IniRead(@scriptdir & "\" & $ini, "Kill on Start", "portal", "")
$info = IniRead(@scriptdir & "\" & $ini, "Kill on Start", "info", "")
$install = IniRead(@scriptdir & "\" & $ini, "Kill on Start", "install", "")
$backup = IniRead(@scriptdir & "\" & $ini, "Run on Start", "backup", "")
$notes = IniRead(@scriptdir & "\" & $ini, "Run on Start", "notes", "")
$end = IniRead(@scriptdir & "\" & $ini, "Run End", "end", "")
$msg = IniRead(@scriptdir & "\" & $ini, "Run End", "msg", "")
If $portal = 1 Then
WinKill("Portal")
Else
EndIf
If $info = 1 Then
WinKill("HDInfo2k")
Else
EndIf
If $install = 1 Then
WinMinimizeAll()
ToolTip("")
WinKill("Install")
WinKill("Error")
Else
EndIf
If $backup = 1 Then
runwait(@programfilesdir & "\IBM\Lotus Notes\BackupNotesData.EXE", "", @SW_HIDE)
Else
EndIf
If $notes = 1 Then
runwait(@programfilesdir & "\IBM\Lotus Notes\notes.exe", "", @SW_MAXIMIZE)
Else
EndIf
If $end = 1 Then
$msg = IniRead(@scriptdir & "\" & $ini, "Run End", "msg", "")
Opt("OnExitFunc", "endscript")
Else
Exit
EndIf
EndFunc
Func endscript()
Do
WinWaitActive("Windows herunterfahren")
until ProcessExists("shutdown.exe")
MsgBox(0, "Remember", "$msg")
EndFunc