#include #include #include Global Const $GUIChildStyle = BitOr($WS_CHILD,$WS_TABSTOP,$WS_Border), $GUIChildExStyle = $WS_EX_WINDOWEDGE Local $GUI = GUICreate("Test", 1000, 1000, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_SIZEBOX, $WS_CLIPCHILDREN, $WS_CLIPSIBLINGS), -1, 0), _ $ChildGUI = GUICreate("", 940, 940, 30, 30, $GUIChildStyle, $GUIChildExStyle, $GUI), _ $ChildGUI2 = GUICreate("", 880, 880, 30, 30, $GUIChildStyle, $GUIChildExStyle, $ChildGUI) GUISwitch($GUI) Local $Tab0 = GUICtrlCreateTab(0, 0, 1000, 1000, -1, -1), _ $Tab0Item0 = GUICtrlCreateTabItem("Level 1") GUICtrlCreateTabItem("") GUISwitch($ChildGUI) Local $Tab1 = GUICtrlCreateTab(0, 0, 940, 940), _ $Tab1Item0 = GUICtrlCreateTabItem("Level 2") GUICtrlCreateTabItem("") GUISwitch($ChildGUI2) GUICtrlCreatelabel("Stuff...", 10, 10, 100, 20) GUISetBkColor(0x000000, $GUI) GUISetBkColor(0xAAAAAA, $ChildGUI) GUISetBkColor(0xFFCC00, $ChildGUI2) GUISetState(@SW_SHOW, $GUI) GUISetState(@SW_SHOW, $ChildGUI) GUISetState(@SW_SHOW, $ChildGUI2) Global Const $User32Dll = DllOpen("user32.dll") GUIRegisterMsg($WM_SIZE, "WM_SIZE") While 1 Switch GUIGetMsg() Case -3 GUIRegisterMsg($WM_SIZE, "") DllClose($User32Dll) Exit EndSwitch WEnd Func WM_SIZE($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $wParam If $hWnd = $GUI Then;This is the main, level 0 GUI Local $tRECT = DllStructCreate($tagRECT) DllCall($User32Dll, "bool", "GetClientRect", "hwnd", $hWnd, "struct*", $tRECT) Local $GUIWidth = $tRECT.Right - $tRECT.Left, $GUIHeight = $tRECT.Bottom - $tRECT.Top ;Adjust the level 1 GUI WinMove($ChildGUI, "", $tRECT.Left + 30, $tRECT.Top + 30, $GUIWidth - 60, $GUIHeight - 60, 0) ;Adjust the level 2 GUI ;=========================> Uncomment the line below to see the error. <========================= ;WinMove($ChildGUI2, "", $tRECT.Left + 30, $tRECT.Top + 30, $GUIWidth - 120, $GUIHeight - 120, 0) ;=========================> Uncomment the line above to see the error. <========================= EndIf Return $GUI_RUNDEFMSG EndFunc