#include <WindowsConstants.au3>
#Include <WinAPI.au3>
Global $ABCD = 0
Global $hMain_GUI = GUICreate("主窗", 440, 343, -1, -1);创建主窗
GUISetBkColor(0xDCE6E8)
Global $button0 = GUICtrlCreateButton("切换", 20, 310, 80, 30)
Global $hSon_GUI_1 = GUICreate("子窗1", 250, 250, 173, 54,BitOR($WS_POPUP, $WS_SYSMENU))
GUISetBkColor(0xFFFF00)
GUICtrlCreateLabel("子窗1-黄色" & @CRLF & @CRLF _
& "点击主窗左下角[切换]按钮," & @CRLF & @CRLF _
& "注:首次点击按钮需2次点击!" & @CRLF & @CRLF _
& "隐藏子窗1,显示子窗2" & @CRLF & @CRLF _
& "脚本运行后,不移动窗口的情况下," & @CRLF & @CRLF _
& "切换操作正常!!!" & @CRLF & @CRLF _
& "一旦移动窗口后,仍可切换子窗," & @CRLF & @CRLF _
& "但子窗1消失,只有子窗2可以显示" & @CRLF & @CRLF _
& "请高手帮忙分析,修改这个BUG,谢谢!!!", 20, 20, 200, 205)
_WinAPI_SetParent($hSon_GUI_1, $hMain_GUI)
Global $hSon_GUI_2 = GUICreate("子窗2", 440, 300, 0, 0, $WS_POPUP, $WS_EX_MDICHILD, $hMain_GUI)
GUISetBkColor(0x0000FF)
GUISetState(@SW_SHOW, $hMain_GUI);显示主窗口
GUISetState(@SW_SHOW, $hSon_GUI_1);显示子窗1
While 1
Switch GUIGetMsg()
Case -3
Exit
Case $button0
ABCD()
EndSwitch
WEnd
Func ABCD();转换到"软件卸载"时,隐藏类按钮组件
If $ABCD = 0 Then
GUISetState(@SW_SHOW, $hSon_GUI_1) ;显示 软件列表 窗口
GUISetState(@SW_HIDE, $hSon_GUI_2) ;隐藏 程序卸载 窗口
$ABCD = 1
ElseIf $ABCD = 1 Then
GUISetState(@SW_HIDE, $hSon_GUI_1) ;隐藏 软件列表 窗口
GUISetState(@SW_SHOW, $hSon_GUI_2) ;显示 程序卸载 窗口
$ABCD = 0
EndIf
EndFunc ;==>ABCD
|