Hiho,
ich habe ein GUI gebastelt, in dem 2 Buttons jeweils ein weiteres GUI öffnen.
Soweit klappt das auch alles, jedoch gibt es 2 probleme.
prob 1
wenn einer der beiden knöpfe gedrückt wurde und gui2 wieder verlassen wurde, kann man sie anschließend nicht erneut öffnen.
prob 2
wenn einer dieser beiden knöpfe gedrückt und gui2 wieder beendet wurde, lässt sich gui1 nicht mehr bedienen.
also ich bin gerade dabei, dass komplette script umzuschreiben, deswegen sind eh noch nicht alle sachen fertig (das GUI zu button 2 existiert noch garnicht, aber das problem wird ja das selbe sein).
Spoiler anzeigen
;create gui 1
$gui = GUICreate($script & " V3", 400, 300, -1, -1, -1, $WS_EX_ACCEPTFILES)
$ok = GUICtrlCreateButton("&OK", 40, 251, 70)
$cancel = GUICtrlCreateButton("&Cancel", 290, 251, 70)
$label = GUICtrlCreateLabel("© blabla", 160, 260)
GUICtrlSetColor(-1, 0x9E9E9E)
GUICtrlSetFont($label, 7)
$menu = GUICtrlCreateMenu("&More")
$infos = GUICtrlCreateMenuitem("&Info", $menu)
$about = GUICtrlCreateMenuitem("&About", $menu)
$language = GUICtrlCreateMenu("&Language")
$eng = GUICtrlCreateMenuitem("&Englisch", $language)
$ger = GUICtrlCreateMenuitem("&German", $language)
;tab1
GUICtrlCreateTab(0, 0, 400, 245)
GUICtrlCreateTabItem("Modify Start")
FileInstall("Henkel2.jpg", @TempDir & "\")
GUICtrlCreatePic(@TempDir & "\Henkel2.jpg", 200, 30, 180, 110)
$cbportal = GUICtrlCreateCheckbox("Close Portal", 30, 40)
GUICtrlSetTip($cbportal, "Closes the Portal if you don´t need it")
If $portal = 1 then GUICtrlSetState($cbportal, 1)
$cbinfo = GUICtrlCreateCheckbox("Close HDInfo-Window", 30, 70)
GUICtrlSetTip($cbinfo, "Closes the HDInfo-Window if you don´t need it")
If $info = 1 then GUICtrlSetState($cbinfo, 1)
$cbinstall = GUICtrlCreateCheckbox("Close Install/Error Windows", 30, 100)
GUICtrlSetTip($cbinstall, "Closes some Error/Install-Windows which sometimes appear")
If $install = 1 then GUICtrlSetState($cbinstall, 1)
GUICtrlCreateLabel("----------------------------------------------------", 30, 130)
$cbbackup = GUICtrlCreateCheckbox("Run Lotus Notes Backup", 30, 150)
GUICtrlSetTip($cbbackup, "Runs the Backup-my-Data-Function for Lotus Notes")
If $backup = 1 then GUICtrlSetState($cbbackup, 1)
$cbnotes = GUICtrlCreateCheckbox("Run Lotus Notes", 30, 180)
GUICtrlSetTip($cbnotes, "Runs Lotus Notes (after the Backup)")
If $notes = 1 then GUICtrlSetState($cbnotes, 1)
$IE = GUICtrlCreateButton("IE-Settings", 290, 160, 70) ;button startet gui 2
$Tools = GUICtrlCreateButton("Tool-Settings", 290, 190, 70)
;tab2
GUICtrlCreateTab(-1, -1, 400, 245)
GUICtrlCreateTabItem("Modify Shutdown")
$cbshutdown = GUICtrlCreateCheckbox("Message before Shutdown", 30, 40)
GUICtrlSetTip($cbshutdown, "Shows a MsgBox with some Information, if you Turn off, Reboot, or Logout")
If $shutdown = 1 then GUICtrlSetState($cbshutdown, 1)
$edit = GUICtrlCreateEdit("Put here your text you want to see before the Shutdown", 10, 70, 380, 150, $ES_AUTOVSCROLL+$ES_AUTOHSCROLL+$ES_WANTRETURN+$ES_MULTILINE)
If $shutdown = 1 then GUICtrlSetData($edit, $inimsg)
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
Select
case $msg = $gui_event_close
Exit
Case $msg = $cancel
Exit
case $msg = $infos
MsgBox(32, "Info", "General:" & @CRLF & "This little program will help you, to modify your systemstart and shutdown with different settings")
case $msg = $about
MsgBox(64, "About", "This tool is written by sc4ry" & @CRLF & @CRLF & " ----------- IFK 2005 -----------")
;IE-Settings GUI
case $msg = $IE ;ruft gui 2 auf
$guiie = GUICreate("IE-Settings", 300, 250)
$ok2 = GUICtrlCreateButton("Ok", 20, 220, 70)
$cancel2 = GUICtrlCreateButton("Cancel", 220, 220, 70)
GUICtrlCreateTab(0, 0, 300, 215)
GUICtrlCreateTabItem("Internet Access")
$access = GUICtrlCreateCheckbox("automatic Internet Access Logon", 50, 40)
GUICtrlSetTip($access, "If you select this option, you will automaticly get access to the Internet, without writing your UserID & PW every time")
GUICtrlCreateLabel("UserID", 50, 82, 50)
$user = GUICtrlCreateInput("", 110, 80, 100)
GUICtrlCreateLabel("Password", 50, 122, 50)
$pw = GUICtrlCreateInput("", 110, 120, 100, "", $ES_PASSWORD)
GUICtrlCreateTab(-1, -1, 300, 215)
GUICtrlCreateTabItem("Sites to open")
GUICtrlCreateLabel("URL 1", 10, 45)
$link1 = GUICtrlCreateInput("", 50, 40, 230, 25)
GUICtrlSetTip(-1, "Please input here a URL, which you want to launch after the Start")
GUICtrlCreateLabel("URL 2", 10, 75)
$link2 = GUICtrlCreateInput("", 50, 70, 230, 25)
GUICtrlSetTip(-1, "Please input here a URL, which you want to launch after the Start")
GUICtrlCreateLabel("URL 3", 10, 105)
$link3 = GUICtrlCreateInput("", 50, 100, 230, 25)
GUICtrlSetTip(-1, "Please input here a URL, which you want to launch after the Start")
GUICtrlCreateLabel("URL 4", 10, 135)
$link4 = GUICtrlCreateInput("", 50, 130, 230, 25)
GUICtrlSetTip(-1, "Please input here a URL, which you want to launch after the Start")
GUICtrlCreateLabel("URL 5", 10, 165)
$link5 = GUICtrlCreateInput("", 50, 160, 230, 25)
GUICtrlSetTip(-1, "Please input here a URL, which you want to launch after the Start")
GUISetState (@SW_SHOW)
While 1
$msg = GUIGetMsg()
Select
case $msg = $gui_event_close
GUIDelete($guiie)
Case $msg = $cancel2
GUIDelete($guiie)
case $msg = $ok2
If GUICtrlRead($access) = 1 Then
IniWrite(@ScriptDir & "\" & $ini, "IE-Settings", "IE Access", "1")
$iniuser = GUICtrlRead($user)
$ieuser = IniWrite(@scriptdir & "\" & $ini, "IE-Settings", "UserID", $iniuser)
$pwEncrypt = _StringEncrypt(1, GUICtrlRead($pw), $pwkey, 4)
$iepw = IniWrite(@scriptdir & "\" & $ini, "IE-Settings", "Password", $pwEncrypt)
Else
IniWrite(@ScriptDir & "\" & $ini, "IE-Settings", "IE Access", "0")
EndIf
$inilink1 = GUICtrlRead($Link1)
IniWrite(@ScriptDir & "\" & $ini, "IE-Settings", "Link 1", $inilink1)
$inilink2 = GUICtrlRead($Link2)
IniWrite(@ScriptDir & "\" & $ini, "IE-Settings", "Link 2", $inilink2)
$inilink3 = GUICtrlRead($Link3)
IniWrite(@ScriptDir & "\" & $ini, "IE-Settings", "Link 3", $inilink3)
$inilink4 = GUICtrlRead($Link4)
IniWrite(@ScriptDir & "\" & $ini, "IE-Settings", "Link 4", $inilink4)
$inilink5 = GUICtrlRead($Link5)
IniWrite(@ScriptDir & "\" & $ini, "IE-Settings", "Link 5", $inilink5)
GUIDelete($guiie)
EndSelect
WEnd
case $msg = $tools ;create gui 2 No. 2 (nicht fertig)
GUICreate("Tool Settings")
GUICtrlCreateLabel("Here you are able to Start some own Tools", 10, 10)
$input1 = GUICtrlCreateInput("", 30, 40, 250, 25)
GUICtrlSetState(-1, $GUI_ACCEPTFILES)
$button1 = GUICtrlCreateButton("Browse&1", 300, 40, 70)
$input2 = GUICtrlCreateInput("", 30, 70, 250, 25)
GUICtrlSetState(-1, $GUI_ACCEPTFILES)
$button2 = GUICtrlCreateButton("Browse&2", 300, 70, 70)
$input3 = GUICtrlCreateInput("", 30, 100, 250, 25)
GUICtrlSetState(-1, $GUI_ACCEPTFILES)
$button3 = GUICtrlCreateButton("Browse&3", 300, 100, 70)
GUISetState (@SW_SHOW)
Case $msg = $ok ;bedingungen von gui 1
If GUICtrlRead($cbportal) = 1 Then
IniWrite(@ScriptDir & "\" & $ini, "Kill on Start", "portal", "1")
Else
IniWrite(@ScriptDir & "\" & $ini, "Kill on Start", "portal", "0")
EndIf
If GUICtrlRead($cbinfo) = 1 Then
IniWrite(@ScriptDir & "\" & $ini, "Kill on Start", "info", "1")
Else
IniWrite(@ScriptDir & "\" & $ini, "Kill on Start", "info", "0")
EndIf
If GUICtrlRead($cbinstall) = 1 Then
IniWrite(@ScriptDir & "\" & $ini, "Kill on Start", "install", "1")
Else
IniWrite(@ScriptDir & "\" & $ini, "Kill on Start", "install", "0")
EndIf
If GUICtrlRead($cbbackup) = 1 Then
IniWrite(@ScriptDir & "\" & $ini, "Run on Start", "backup", "1")
Else
IniWrite(@ScriptDir & "\" & $ini, "Run on Start", "backup", "0")
EndIf
If GUICtrlRead($cbnotes) = 1 Then
IniWrite(@ScriptDir & "\" & $ini, "Run on Start", "notes", "1")
Else
IniWrite(@ScriptDir & "\" & $ini, "Run on Start", "notes", "0")
EndIf
If GUICtrlRead($cbshutdown) = 1 Then
IniWrite(@ScriptDir & "\" & $ini, "Run End", "end", "1")
$editmsg = GUICtrlRead($edit, 1)
IniWrite(@ScriptDir & "\" & $ini, "Run End", "msg", StringReplace($editmsg, @CRLF, "[CRLF]"))
Opt("OnExitFunc", "endscript")
Else
IniWrite(@ScriptDir & "\" & $ini, "Run End", "end", "0")
Exit
EndIf