应该是这样的效果吧。
还需要什么功能,自行修改一下。
#include <GuiConstants.au3>
#include <WindowsConstants.au3>
#include <winapi.au3>
Opt("GUIOnEventMode", 1)
$Main_GUI = GUICreate("Main", 500, 500)
GUISetOnEvent($GUI_EVENT_CLOSE, "_GuiMsg")
GUISetBkColor(0x008040, $Main_GUI)
$Btn_Show = GUICtrlCreateButton("Show All", 10, 10, 90, 20)
GUISetState(@SW_SHOW, $Main_GUI)
$Child_GUI = GUICreate("Child", 500, 450, 0, 50, $WS_CHILD, -1, $Main_GUI)
GUISetBkColor(0x0080C0, $Child_GUI)
GUISetState(@SW_SHOW, $Child_GUI)
$Child1_GUI = GUICreate("Child1", 200, 100, 10, 50, BitOR($WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_SIZEBOX))
GUISetOnEvent($GUI_EVENT_CLOSE, "_GuiMsg")
GUISetBkColor(0xFFFFFF, $Child1_GUI)
$Btn_Test1 = GUICtrlCreateButton("Test", 10, 10, 90, 20)
GUISetState(@SW_SHOW, $Child1_GUI)
$Child2_GUI = GUICreate("Child2", 200, 100, 10, 50, BitOR($WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_SIZEBOX))
GUISetOnEvent($GUI_EVENT_CLOSE, "_GuiMsg")
GUISetBkColor(0xFFFFFF, $Child2_GUI)
$Btn_Test2 = GUICtrlCreateButton("Test", 10, 10, 90, 20)
GUISetState(@SW_SHOW, $Child2_GUI)
$Child3_GUI = GUICreate("Child3", 200, 100, 10, 50, BitOR($WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_SIZEBOX))
GUISetOnEvent($GUI_EVENT_CLOSE, "_GuiMsg")
GUISetBkColor(0xFFFFFF, $Child3_GUI)
$Btn_Test3 = GUICtrlCreateButton("Test", 10, 10, 90, 20)
GUISetState(@SW_SHOW, $Child3_GUI)
_WinAPI_SetParent($Child1_GUI,$Child_GUI)
_WinAPI_SetParent($Child2_GUI,$Child_GUI)
_WinAPI_SetParent($Child3_GUI,$Child_GUI)
GUICtrlSetOnEvent($Btn_Show, "_GuiMsg")
GUICtrlSetOnEvent($Btn_Test1, "_GuiMsg")
GUICtrlSetOnEvent($Btn_Test2, "_GuiMsg")
GUICtrlSetOnEvent($Btn_Test3, "_GuiMsg")
While 1
Sleep(250)
WEnd
Func _GuiMsg()
Switch @GUI_CTRLID
Case $GUI_EVENT_CLOSE
Switch @GUI_WinHandle
Case $Main_GUI
Exit
Case $Child1_GUI
GUISetState(@SW_HIDE,$Child1_GUI )
Case $Child2_GUI
GUISetState(@SW_HIDE,$Child2_GUI )
Case $Child3_GUI
GUISetState(@SW_HIDE,$Child3_GUI )
EndSwitch
Case $Btn_Show
GUISetState(@SW_SHOW,$Child1_GUI )
GUISetState(@SW_SHOW,$Child2_GUI )
GUISetState(@SW_SHOW,$Child3_GUI )
Case $Btn_Test1,$Btn_Test2,$Btn_Test3
MsgBox(64,"测试","我是一个子窗口")
EndSwitch
EndFunc
|