; AZJIO
; http://www.autoitscript.com/forum/topic/151528-getchildcoor-setcoor/
#include <WindowsConstants.au3>
#Include <UserGUI.au3>

$hGui = GUICreate('My program', 420, 250, 50, 50)
$MsgBox = GUICtrlCreateButton("Button", 20, 20, 90, 30)
GUISetState()

While 1
	Switch GUIGetMsg()
		Case $MsgBox
			_MsgBox($hGui)
		Case -3
			Exit
	EndSwitch
WEnd

Func _MsgBox($hGui)
	Local $EditBut, $hGui1, $aRect, $msg, $StrBut
	$aRect = _GetChildCoor($hGui, 410, 240)
	GUISetState(@SW_DISABLE, $hGui)
	
	$hGui1 = GUICreate('Сообщение', $aRect[0], $aRect[1], $aRect[2], $aRect[3], BitOR($WS_CAPTION, $WS_SYSMENU, $WS_POPUP), -1, $hGui)
	GUICtrlCreateLabel('Что будем делать сейчас?', 20, 10, 180, 23)
	$EditBut = GUICtrlCreateButton('Редактор', 10, 40, 80, 25)
	$StrBut = GUICtrlCreateButton('Калькулятор', 100, 40, 80, 25)
	GUISetState(@SW_SHOW, $hGui1)
	While 1
		Switch GUIGetMsg()
			Case $EditBut
				Run('Notepad.exe')
			Case $StrBut
				ShellExecute('Calc.exe')
			Case -3
				GUISetState(@SW_ENABLE, $hGui)
				GUIDelete($hGui1)
				ExitLoop
		EndSwitch
	WEnd
EndFunc