#include <GUIConstantsEx.au3>
#include <WinAPI.au3>

$hMain = GUICreate('Основное окно', 600, 500)
$nButton = GUICtrlCreateButton('Дочернее', 20, 470, 70, 20)
GUISetState(@SW_SHOW, $hMain)
$hChild = GUICreate("Дочернее окно", 300, 250, (600 - 300) / 2, (500 - 250) / 2)
_WinAPI_SetParent($hChild, $hMain)
While 1
	Switch GUIGetMsg()
		Case $GUI_EVENT_CLOSE
			Exit
		Case $nButton
			GUISetState(@SW_SHOW, $hChild)
	EndSwitch
WEnd