ต้องการจะซ่อนหน้าต่างโปรแกรม มากกว่า 1 หน้าต่าง ควรใช้คำสั่งใดครับ
ลองใช้ GUISetState(@SW_HIDE) แล้วมันซ่อนได้แค่แรก หน้าต่างเดียวครับ
ลองใช้ GUISetState(@SW_HIDE) แล้วมันซ่อนได้แค่แรก หน้าต่างเดียวครับ
For $i = 1 to handleสุดท้ายของ GuiCreate
GUISetState(@SW_HIDE,$i)
Next
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Dim $guih[3] ;;;;;;;;;;2
$Form1 = GUICreate("1", 200, 100, 0, 0)
$guih[0] = WinGetHandle($Form1) ;;;;;;;;2
$Button1 = GUICtrlCreateButton("1", 70, 34, 75, 25)
GUISetState(@SW_SHOW)
$Form2 = GUICreate("2", 200, 100, 210, 0)
$guih[1] = WinGetHandle($Form2) ;;;;;;;;;;;2
$Button2 = GUICtrlCreateButton("2", 70, 34, 75, 25)
GUISetState(@SW_SHOW)
$Form3 = GUICreate("3", 200, 100, 420, 0)
$guih[2] = WinGetHandle($Form3) ;;;;;;;;;;;;;;2
$Button3 = GUICtrlCreateButton("3", 70, 34, 75, 25)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg(1)
Switch $nMsg[1]
Case $Form1
Switch $nMsg[0]
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
;;;;;;;;;;;;;;;;1
GUISetState(@SW_HIDE, $Form1)
GUISetState(@SW_HIDE, $Form2)
GUISetState(@SW_HIDE, $Form3)
EndSwitch
Case $Form2
Switch $nMsg[0]
Case $GUI_EVENT_CLOSE
GUISetState(@SW_HIDE, $Form2)
Case $Button2
;;;;;;;;;;;;2
For $i = 0 To UBound($guih) - 1
GUISetState(@SW_HIDE, $guih[$i])
Next
EndSwitch
Case $Form3
Switch $nMsg[0]
Case $GUI_EVENT_CLOSE
GUISetState(@SW_HIDE, $Form3)
Case $Button3
MsgBox(0, "xxxxxxx", "xxxxxxx")
EndSwitch
EndSwitch
WEnd
|
|