Miliardsto,
How about this:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$hGUI = GUICreate("Test", 500, 500, -1, -1)
$cButton_0 = GUICtrlCreateButton("Child 0", 10, 10, 80, 30)
$cButton_1 = GUICtrlCreateButton("Child 1", 10, 50, 80, 30)
$cButton_2 = GUICtrlCreateButton("Child 2", 10, 90, 80, 30)
GUISetState(@SW_SHOW, $hGUI)
; guis
Global $hChild_[3]
Global $countGUI = UBound($hChild_) - 1
Global $gui = 0
$hChild_[0] = GUICreate("Child 0", 350, 300, 150, 0, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
GUISetBkColor(0xFF0000)
GUISetState(@SW_SHOW, $hChild_[0])
$hChild_[1] = GUICreate("Child 1", 350, 300, 150, 0, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
GUISetBkColor(0x00FF00)
GUISetState(@SW_HIDE, $hChild_[1])
$hChild_[2] = GUICreate("Child 2", 350, 300, 150, 0, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
GUISetBkColor(0x0000FF)
GUISetState(@SW_HIDE, $hChild_[2])
GUIRegisterMsg($WM_NCHITTEST, "_NCHITTEST")
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $cButton_0
_All_Hide()
GUISetState(@SW_SHOW, $hChild_[0])
$gui = 0
Case $cButton_1
_All_Hide()
GUISetState(@SW_SHOW, $hChild_[1])
$gui = 1
Case $cButton_2
_All_Hide()
GUISetState(@SW_SHOW, $hChild_[2])
$gui = 2
EndSwitch
WEnd
Func _All_Hide()
GUISetState(@SW_HIDE, $hChild_[0])
GUISetState(@SW_HIDE, $hChild_[1])
GUISetState(@SW_HIDE, $hChild_[2])
EndFunc
Func _NCHITTEST($hWnd, $iMsg, $wParam, $lParam)
For $i = 0 To $countGUI
If $hWnd = $hChild_[$i] Then
Local $aPos = WinGetPos($hWnd)
If Abs(BitAND(BitShift($lParam, 16),0xFFFF)- $aPos[1]) < 500 Then Return $HTCAPTION
ExitLoop
EndIf
Next
Return $GUI_RUNDEFMSG
EndFunc
M23