Global $mainwindow Global $childwin1 Global $Button_Main1 Global $Button_Child1 _main() Func _main() $mainwindow = GUICreate("Test", 340, 500) $Button_Main1 = GUICtrlCreateButton("Öffne Dialog", 20, 20, 100, 50) GUISetState() While 1 Switch GUIGetMsg() Case -3 exit Case $Button_Main1 _Childwin1() EndSwitch WEnd EndFunc Func _Childwin1() $childwin1 = GUICreate("Child GUI", 350, 350, 100, 100, -1, -1, $mainwindow) $Button_Child1 = GUICtrlCreateButton("Mach Was", 20, 20, 100, 50) GUISetState() While 1 Switch GUIGetMsg() Case -3 GUIDelete() Case $Button_Child1 _MachWas("Hallo") EndSwitch WEnd EndFunc Func _MachWas($Ausgabetext) MsgBox(0,"Info",$Ausgabetext) EndFunc