找回密码
 加入
搜索
查看: 8361|回复: 7

[交流] 请教个消息循环的问题(已解决)

  [复制链接]
发表于 2011-11-22 16:08:54 | 显示全部楼层 |阅读模式
本帖最后由 HebeMoon 于 2011-11-22 17:27 编辑

RT,刚做了个GUI的界面~主要是得到路径然后找文件~
现在问题是我点完OK button后会去判断路径是佛正确,如果不正确我会给你出个message,问题就在这~
我希望是点完MessageBox上面的OK button后,我最开始输入路径的那个window不会关闭~
实际上是点完它自己就关闭了~
下面是我的主要代码~
Func Window()
        Local $SourcePath,$FilePath,$BuildNumber ,$btnOK,$btnCancel, $msg
        $msg = 0

        GUICreate("Auto It For Building", 500, 300, (@DesktopWidth - 500)/ 2, (@DesktopHeight - 300) / 2, -1); WS_EX_ACCEPTFILES
        GUICtrlCreateGroup("Group 1", 20,20, 460, 260)
        GUICtrlCreateLabel("Install Sourcr Path:", 40, 50,90,30)
        $SourcePath = GUICtrlCreateInput("", 135,40, 330, 30)
        GUICtrlCreateLabel("Update File Path:", 40, 95,90,30)
        $FilePath = GUICtrlCreateInput("", 135,90, 330, 30)
        GUICtrlCreateLabel("Build Number:", 40, 135,90,30)
        $BuildNumber = GUICtrlCreateInput("", 135,130, 100, 30)
        $btnOK = GUICtrlCreateButton("Ok", 270, 230, 70, 30)
        $btnCancel = GUICtrlCreateButton("Cancel", 370, 230, 70, 30)
        GUISetState()


        While $msg <> $GUI_EVENT_CLOSE
                $msg = GUIGetMsg()
                Select
                        Case $msg = $btnCancel
                                ExitLoop
                        Case $msg = $btnOK
                                If (CheckStatus($FilePath)) Then
                                        If (CheckStatus($SourcePath)) Then
                                                ;UpdateFiles()
                                                MsgBox (0, "Successful","Happy!")
                                                ExitLoop
                                        Else
                                                ContinueLoop
                                        EndIf
                                Else
                                        ContinueLoop
                                EndIf
                        EndSelect
        WEnd
EndFunc   ;==>Example
 楼主| 发表于 2011-11-22 16:11:08 | 显示全部楼层
我看到有个GUIRegisterMsg这函数~
help上面是说注册个自定义的消息类型~
我也看过例子,感觉问题就这里,可是没看明白,定义完了后,没见有地方去判断消息是不是这个类型呀~
有高人给解答下么~
谢谢
 楼主| 发表于 2011-11-22 16:16:07 | 显示全部楼层
木有人吗????
在线等压~
发表于 2011-11-22 16:22:47 | 显示全部楼层
(菜鸟)完全copy下来运行在win7下面木跳出任何界面么。
 楼主| 发表于 2011-11-22 16:32:18 | 显示全部楼层
亲,这个里面又调用别的函数~你直接copy下来运行会提示有函数没定义的~
 楼主| 发表于 2011-11-22 16:33:59 | 显示全部楼层
哦,对了,你没看这只是个函数定义,要执行的~
 楼主| 发表于 2011-11-22 17:27:29 | 显示全部楼层
哎,问题解决了,是我没弄清楚~问题出在CheckStatus这个函数里~
发表于 2012-7-22 23:12:23 | 显示全部楼层
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-3-29 23:30 , Processed in 0.070947 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表