tzz365 发表于 2010-3-5 18:28:18

GUI使用

一个程序有二个GUI。GUI1 ,GUI2

GUI1一直运行。 GUI2点取消时退出,但GUI1继续运行。请问如何做到。

xlcwxl 发表于 2010-3-5 18:40:29

回复 1# tzz365 #include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 375, 242, 192, 124)
$Button1 = GUICtrlCreateButton("打开", 40, 96, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        form2()       
        EndSwitch
WEnd


Func form2()
$Form3 = GUICreate("窗体1", 413, 298, 197, 135)
GUISetState(@SW_SHOW)
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        GUIDelete($Form3)
                        ExitLoop
        EndSwitch
WEnd
EndFunc

tzz365 发表于 2010-3-5 20:42:04

点确定,弹出确定和取消。点取消关闭GUI2   点确定运行QQGAME
请问如何设置
Global $time = 30
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("test", 350, 172, 193, 125)
$gaway1 = GUICtrlCreateLabel("test", 107, 15, 120, 17)
GUICtrlSetFont(-1, 15, 400, 0, "楷体_GB2312")
$Label1 = GUICtrlCreateLabel("30秒后test!", 1, 50, 400, 28)
GUICtrlSetFont(-1, 12, 400, 0, "楷体_GB2312")
$Progress1 = GUICtrlCreateProgress(8, 88, 333, 17)
$Button1 = GUICtrlCreateButton("确定(&Y)", 53, 128, 73, 25, 0)
$Button2 = GUICtrlCreateButton("退出(&X)", 210, 128, 73, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
AdlibRegister("_timer", 1000)
While 1
      $nMsg = GUIGetMsg()
      Switch $nMsg
                Case $GUI_EVENT_CLOSE, $Button2
                        Exit
                Case $Button1
                        ExitLoop
      EndSwitch
      If $time <= 0 Then ExitLoop
WEnd
main()
Exit

Func _timer()
      $time -= 1
      GUICtrlSetData($Label1, $time & "秒后test")
      GUICtrlSetData($Progress1, (30 - $time) / 0.3)
      If $time <= 0 Then AdlibUnRegister()
EndFunc   ;==>_timer

Func main()
Run("D:\Program Files\腾讯游戏\QQGAME\QQGame.exe");qq
EndFunc   ;==>main

lanfengc 发表于 2010-3-5 21:15:40

这样的代码我都懒得写了。 你就不会用下论坛的搜索吗???

那么多双窗口的例子你不找。非要开个新帖占论坛空间。。无奈死了。

http://autoitx.com/forum.php?mod=viewthread&tid=13067&rpid=137835&ordertype=0&page=1#pid137835

tzz365 发表于 2010-3-6 10:09:31

回复 4# lanfengc


    高手能不能帮小弟改编下。。我做了好久都不行。。。
页: [1]
查看完整版本: GUI使用