Vielen Dank für eure Hilfe!
Habe es nach dem Schema gelöst.
AutoIt
#include <GUIConstantsEx.au3>
Global $gui2 = 9999, $button3 = 9999
gui1()
Func gui1()
$gui1 = GUICreate("Gui 1", 200, 200, -1, -1)
$button1 = GUICtrlCreateButton("Show Gui 1", 20, 20, 100, 20)
$button2 = GUICtrlCreateButton("Msgbox", 20, 40, 100, 20)
GUISetState()
While 1
$aMsg = GUIGetMsg(1) ; Use advanced parameter to get array
Switch $aMsg[1] ; check which GUI sent the message
Case $gui1
Switch $aMsg[0] ; Now check for the messages for $gui1
Case $GUI_EVENT_CLOSE
ExitLoop
Case $button1
GUICtrlSetState($button1, $GUI_DISABLE)
gui2()
Case $button2
MsgBox("", "msgbox", "test from gui1")
EndSwitch
Case $gui2
Switch $aMsg[0] ; Now check for the messages for $gui2
Case $GUI_EVENT_CLOSE
GUIDelete($gui2)
GUICtrlSetState($button1, $GUI_ENABLE)
Case $button3
MsgBox("", "msgbox", "test from gui2")
EndSwitch
EndSwitch
WEnd
EndFunc ;==>gui1
Func gui2()
$gui2 = GUICreate("Gui 2", 200, 200, -1, -1)
$button3 = GUICtrlCreateButton("Button1", 20, 20, 40, 20)
GUISetState()
EndFunc ;==>gui2
Alles anzeigen