3 Gui in einem Script, alle einzelnd schließen?

12/25/2010 00:46 puzzlr#1
Hallo.
Mein Problem ist oben eigl. schon beschrieben. Ich kriege es hin, dass ich die ersten Beiden einzelnd schließen kann, beim Dritten Harperts jedoch -.-..

Hier der relevante Part :

PHP Code:
#Region ### START Koda GUI section ### Form=
$MainGui = GUICreate("Farmer by u_failed", 186, 162, 193, 125)
Guiinhalt..
#EndRegion ### END Koda GUI section ###

#Region ### START Koda GUI section ### Form=
$Updates = GUICreate("Check for Updates", 652, 443, 378, 132)
    
GuiInhalt
#EndRegion ### END Koda GUI section ###

#Region ### START Koda GUI section ### Form=
$Koord = GUICreate("Koordinaten", 148, 231, 303, 219)
GuiInhalt
#EndRegion ### END Koda GUI section ###


While 1
    $aMsg 
= GUIGetMsg (True)
        Switch 
$aMsg[0]
            Case 
$GUI_EVENT_CLOSE
                
If ($aMsg[1] == $MainGui) Then
                    ExitLoop
                
ElseIf ($aMsg[1] == $Updates) Then
                    GUIDelete 
($Updates)
                EndIf
            Case 
$Button1
                GUISetState
(@SW_SHOW, $Updates)
                
MsgBox(0, "Info", "Version: v0.2 | Please check out my thread for updates!", 2)
            Case 
$Button2
                MsgBox
(0, "Credits", "Geschrieben von u_failed aus elitepvpers.com", 10)
            Case 
$Button3
            _START
()
            Case 
$Button4
            _Own
()
            EndSwitch
WEnd 
Wie bau ich da jetzt noch ein dass man $Koord mit GUI_EVENT_CLOSE schließen kann?

schönen abend! =D
12/25/2010 10:33 Lighthex#2
Besser ist einzelne Switch-Abfragen für jedes GUI zu haben.
Also :
PHP Code:
#Region ### START Koda GUI section ### Form=
$MainGui = GUICreate("Farmer by u_failed", 186, 162, 193, 125)
Guiinhalt..
#EndRegion ### END Koda GUI section ###

#Region ### START Koda GUI section ### Form=
$Updates = GUICreate("Check for Updates", 652, 443, 378, 132)
    
GuiInhalt
#EndRegion ### END Koda GUI section ###

#Region ### START Koda GUI section ### Form=
$Koord = GUICreate("Koordinaten", 148, 231, 303, 219)
GuiInhalt
#EndRegion ### END Koda GUI section ###

While 1
    $MainMsg 
= GUIGetMsg ($MainGui)
    Switch 
$MainMsg
        
Case $GUI_EVENT_CLOSE 
            
Exit
            ;
deine ganzen weiteren Button Controls etc...
    EndSwitch
    If 
WinExists("Check for Updates") Then
        $UpdateMsg 
= GUIGetMsg($Updates)
        Switch 
$UpdateMsg
            
Case $GUI_EVENT_CLOSE 
                GUIDelete
($Updates)
                ;
alles was du eben noch so machen willst
        
EndSwitch
    EndIf
    If 
WinExists("Koordinaten") Then
       $KoordMsg 
= GuiGetMsg($Koord)
        Switch 
$KoordMsg
            
Case $GUI_EVENT_CLOSE
                GUIDelete
($Koord)
                ;
alles was du eben noch so machen willst
        
EndSwitch
    EndIf
WEnd 
12/25/2010 11:38 puzzlr#3
werd ich gleich mal probieren, danke :)

edit: funktioniert nicht. jetzt lässt sich keines mehr schließen ;>
12/25/2010 11:57 KDeluxe#4
Was hat man den davon nur einen kleinen Teil seines Scripts zu posten?
So wie es aussieht würde es sowieso niemand benutzen.

Besser ist auf jeden Fall das:
PHP Code:
#include <GUIConstantsEx.au3>

#Region ### START Koda GUI section ### Form=
$MainGui = GUICreate("Farmer by u_failed", 186, 162, 193, 125)
;
Guiinhalt...
#EndRegion ### END Koda GUI section ###

#Region ### START Koda GUI section ### Form=
$Updates = GUICreate("Check for Updates", 652, 443, 378, 132)
;
GuiInhalt...
#EndRegion ### END Koda GUI section ###

#Region ### START Koda GUI section ### Form=
$Koord = GUICreate("Koordinaten", 148, 231, 303, 219)
;
GuiInhalt...
#EndRegion ### END Koda GUI section ###

GUISetState(@SW_SHOW, $MainGui)

While 
Sleep(10)
    
$nMsg = GUIGetMsg(True)
    If 
$nMsg[1] == $MainGui Then
        
Switch $nMsg[0]
            Case 
$GUI_EVENT_CLOSE
                
Exit
            ;...
        EndSwitch
    ElseIf 
$nMsg[1] == $Updates Then
        
Switch $nMsg[0]
            Case 
$GUI_EVENT_CLOSE
                GUISetState
(@SW_HIDE, $Updates)
            ;...
        EndSwitch
    ElseIf 
$nMsg[1] == $Koord Then
        
Switch $nMsg[0]
            Case 
$GUI_EVENT_CLOSE
                GUISetState
(@SW_HIDE, $Koord)
            ;...
        EndSwitch
    EndIf
WEnd 
12/25/2010 12:06 puzzlr#5
Quote:
Originally Posted by KillerDeluxe View Post
Was hat man den davon nur einen kleinen Teil seines Scripts zu posten?
So wie es aussieht würde es sowieso niemand benutzen.

Besser ist auf jeden Fall das:
PHP Code:
#include <GUIConstantsEx.au3>

#Region ### START Koda GUI section ### Form=
$MainGui = GUICreate("Farmer by u_failed", 186, 162, 193, 125)
;
Guiinhalt...
#EndRegion ### END Koda GUI section ###

#Region ### START Koda GUI section ### Form=
$Updates = GUICreate("Check for Updates", 652, 443, 378, 132)
;
GuiInhalt...
#EndRegion ### END Koda GUI section ###

#Region ### START Koda GUI section ### Form=
$Koord = GUICreate("Koordinaten", 148, 231, 303, 219)
;
GuiInhalt...
#EndRegion ### END Koda GUI section ###

GUISetState(@SW_SHOW, $MainGui)

While 
Sleep(10)
    
$nMsg = GUIGetMsg(True)
    If 
$nMsg[1] == $MainGui Then
        
Switch $nMsg[0]
            Case 
$GUI_EVENT_CLOSE
                
Exit
            ;...
        EndSwitch
    ElseIf 
$nMsg[1] == $Updates Then
        
Switch $nMsg[0]
            Case 
$GUI_EVENT_CLOSE
                GUISetState
(@SW_HIDE, $Updates)
            ;...
        EndSwitch
    ElseIf 
$nMsg[1] == $Koord Then
        
Switch $nMsg[0]
            Case 
$GUI_EVENT_CLOSE
                GUISetState
(@SW_HIDE, $Koord)
            ;...
        EndSwitch
    EndIf
WEnd 
Danke, funktioniert ;)..

Was hättest du davon, wenn ich den ganzen Script gepostet hätte? - Richtig. Nichts.