Fenster schließen nach eingeben

  • Spoiler anzeigen


    Als erstes habe ich ein Game für IRC gemacht und ich will ein Tool dazu schreiben^^
    Mein Problem ist:
    sobald ich SpielerName eingebe kommt "Deine Account Daten wurden gefunden!" (soll ja auch)
    und nun will ich das sich ein fenster öffnet (Bild) aber das linke soll sich dabei schließen, wie geht das?
    sobald ich den command "exit" benutze schließt sich alles auch das was sich öffnen soll, danke im vorraus

    Spoiler anzeigen


    geht das überhaupt?

    Einmal editiert, zuletzt von ThePierre (13. März 2010 um 14:40)

  • Grundsätzlich könntest du sowas mit @SW_HIDE erreichen. Code wäre schön gewesen.

    Hier mal ein simpler GUI Switch im OnEventMode.

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    Opt("GUIOnEventMode", 1)
    $gui1 = GUICreate("GUI-1", 259, 46)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
    $Button1 = GUICtrlCreateButton("zu GUI-1", 8, 8, 75, 25, $WS_GROUP)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $Button2 = GUICtrlCreateButton("zu GUI-2", 88, 8, 75, 25, $WS_GROUP)
    GUICtrlSetOnEvent(-1, "_show2")
    $Button3 = GUICtrlCreateButton("zu GUI-3", 168, 8, 75, 25, $WS_GROUP)
    GUICtrlSetOnEvent(-1, "_show3")
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    $gui2 = GUICreate("GUI-2", 259, 46)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
    $Button1 = GUICtrlCreateButton("zu GUI-1", 8, 8, 75, 25, $WS_GROUP)
    GUICtrlSetOnEvent(-1, "_show1")
    $Button2 = GUICtrlCreateButton("zu GUI-2", 88, 8, 75, 25, $WS_GROUP)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $Button3 = GUICtrlCreateButton("zu GUI-3", 168, 8, 75, 25, $WS_GROUP)
    GUICtrlSetOnEvent(-1, "_show3")
    GUISetState(@SW_HIDE)

    [/autoit] [autoit][/autoit] [autoit]

    $gui3 = GUICreate("GUI-3", 259, 46)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
    $Button1 = GUICtrlCreateButton("zu GUI-1", 8, 8, 75, 25, $WS_GROUP)
    GUICtrlSetOnEvent(-1, "_show1")
    $Button2 = GUICtrlCreateButton("zu GUI-2", 88, 8, 75, 25, $WS_GROUP)
    GUICtrlSetOnEvent(-1, "_show2")
    $Button3 = GUICtrlCreateButton("zu GUI-3", 168, 8, 75, 25, $WS_GROUP)
    GUICtrlSetState(-1, $GUI_DISABLE)
    GUISetState(@SW_HIDE)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    Sleep(100)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _show1()
    GUISetState(@SW_HIDE, $gui2)
    GUISetState(@SW_HIDE, $gui3)
    GUISetState(@SW_SHOW, $gui1)
    EndFunc ;==>_show1

    [/autoit] [autoit][/autoit] [autoit]

    Func _show2()
    GUISetState(@SW_HIDE, $gui1)
    GUISetState(@SW_HIDE, $gui3)
    GUISetState(@SW_SHOW, $gui2)
    EndFunc ;==>_show2

    [/autoit] [autoit][/autoit] [autoit]

    Func _show3()
    GUISetState(@SW_HIDE, $gui1)
    GUISetState(@SW_HIDE, $gui2)
    GUISetState(@SW_SHOW, $gui3)
    EndFunc ;==>_show3

    [/autoit] [autoit][/autoit] [autoit]

    Func _exit()
    Exit
    EndFunc ;==>_exit

    [/autoit]
  • ok wenn du schon danach fragst:

    [autoit]

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("AlphaMatch Game Tool", 251, 127, -1, -1)
    GUISetIcon("D:\008.ico")
    $passwort = GUICtrlCreateInput("", 8, 64, 233, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
    $ButtonOk = GUICtrlCreateButton("&OK", 86, 96, 75, 25, 0)
    $ButtonCancel = GUICtrlCreateButton("&Cancel", 167, 96, 75, 25, 0)
    $EnterPassLabel = GUICtrlCreateLabel("Enter password and you Name", 8, 12, 149, 17)
    $name = GUICtrlCreateInput("", 8, 40, 233, 21)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit][autoit][/autoit][autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    case $ButtonOk
    msgbox( 32, "Found", "Deine Account Daten wurden gefunden!")
    sleep(5000)
    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <TabConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form2 = GUICreate("AlphaMatch Game Tool - by pierre96", 411, 269, 298, 285)
    GUISetIcon("D:\005.ico")
    $Fenster = GUICtrlCreateTab(8, 8, 396, 256)
    GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
    $TabSheet1 = GUICtrlCreateTabItem("Main Char")
    $Button5 = GUICtrlCreateButton("Meine Waffe", 16, 128, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $Button6 = GUICtrlCreateButton("Mein Inventar", 16, 88, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $Button4 = GUICtrlCreateButton("Meine Information", 16, 48, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $TabSheet2 = GUICtrlCreateTabItem("Upgrading")
    $Button7 = GUICtrlCreateButton("Downen", 16, 48, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $Button8 = GUICtrlCreateButton("Upgraden", 16, 88, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $Button9 = GUICtrlCreateButton("", 16, 128, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $TabSheet3 = GUICtrlCreateTabItem("Kämpfen (Monster)")
    $LvL2 = GUICtrlCreateButton("Level 2", 16, 48, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $LvL3 = GUICtrlCreateButton("Level 3", 16, 88, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $LvL4 = GUICtrlCreateButton("Level 4", 16, 128, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $LvL5 = GUICtrlCreateButton("Level 5", 16, 168, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $LvL6 = GUICtrlCreateButton("Level 6", 16, 208, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $LvL7 = GUICtrlCreateButton("Level 7", 120, 48, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $LvL8 = GUICtrlCreateButton("Level 8", 120, 88, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $LvL9 = GUICtrlCreateButton("Level 9", 120, 128, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $LvL10 = GUICtrlCreateButton("Level 10", 120, 168, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $LvL11 = GUICtrlCreateButton("Level 11 (Stark)", 120, 208, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $TabSheet4 = GUICtrlCreateTabItem("Befehle")
    GUICtrlCreateTabItem("")
    $Button2 = GUICtrlCreateButton("&Exit", 286, 48, 99, 33, $WS_GROUP)
    $Button3 = GUICtrlCreateButton("&Help", 286, 88, 99, 33, $WS_GROUP)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit][autoit][/autoit][autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit][autoit][/autoit][autoit]

    EndSwitch
    WEnd

    [/autoit][autoit][/autoit][autoit]

    EndSwitch
    WEnd

    [/autoit]
  • bitte immer code mitposten dann gehts viel schneller ;)

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("AlphaMatch Game Tool", 251, 127, -1, -1)
    GUISetIcon("D:\008.ico")
    $passwort = GUICtrlCreateInput("", 8, 64, 233, 21, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL))
    $ButtonOk = GUICtrlCreateButton("&OK", 86, 96, 75, 25, 0)
    $ButtonCancel = GUICtrlCreateButton("&Cancel", 167, 96, 75, 25, 0)
    $EnterPassLabel = GUICtrlCreateLabel("Enter password and you Name", 8, 12, 149, 17)
    $name = GUICtrlCreateInput("", 8, 40, 233, 21)
    GUISetState(@SW_SHOW, $Form1)
    #endregion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    #region ### START Koda GUI section ### Form=
    $Form2 = GUICreate("AlphaMatch Game Tool - by pierre96", 411, 269, 298, 285)
    GUISetIcon("D:\005.ico")
    $Fenster = GUICtrlCreateTab(8, 8, 396, 256)
    GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
    $TabSheet1 = GUICtrlCreateTabItem("Main Char")
    $Button5 = GUICtrlCreateButton("Meine Waffe", 16, 128, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $Button6 = GUICtrlCreateButton("Mein Inventar", 16, 88, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $Button4 = GUICtrlCreateButton("Meine Information", 16, 48, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $TabSheet2 = GUICtrlCreateTabItem("Upgrading")
    $Button7 = GUICtrlCreateButton("Downen", 16, 48, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $Button8 = GUICtrlCreateButton("Upgraden", 16, 88, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $Button9 = GUICtrlCreateButton("", 16, 128, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $TabSheet3 = GUICtrlCreateTabItem("Kämpfen (Monster)")
    $LvL2 = GUICtrlCreateButton("Level 2", 16, 48, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $LvL3 = GUICtrlCreateButton("Level 3", 16, 88, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $LvL4 = GUICtrlCreateButton("Level 4", 16, 128, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $LvL5 = GUICtrlCreateButton("Level 5", 16, 168, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $LvL6 = GUICtrlCreateButton("Level 6", 16, 208, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $LvL7 = GUICtrlCreateButton("Level 7", 120, 48, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $LvL8 = GUICtrlCreateButton("Level 8", 120, 88, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $LvL9 = GUICtrlCreateButton("Level 9", 120, 128, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $LvL10 = GUICtrlCreateButton("Level 10", 120, 168, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $LvL11 = GUICtrlCreateButton("Level 11 (Stark)", 120, 208, 97, 33, $WS_GROUP)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $TabSheet4 = GUICtrlCreateTabItem("Befehle")
    GUICtrlCreateTabItem("")
    $Button2 = GUICtrlCreateButton("&Exit", 286, 48, 99, 33, $WS_GROUP)
    $Button3 = GUICtrlCreateButton("&Help", 286, 88, 99, 33, $WS_GROUP)
    GUISetState(@SW_HIDE, $Form2)
    #endregion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $ButtonOk
    MsgBox(32, "Found", "Deine Account Daten wurden gefunden!")
    Sleep(1000)
    GUISetState(@SW_HIDE, $Form1)
    GUISetState(@SW_SHOW, $Form2)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit]