找回密码
 加入
搜索
查看: 1032|回复: 1

为何无法退出

[复制链接]
发表于 2009-3-17 14:12:17 | 显示全部楼层 |阅读模式
如果密码正确登陆后,脚本程序点击“退出”而无法退出。

[ 本帖最后由 frosee 于 2009-3-21 11:45 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2009-3-17 14:23:41 | 显示全部楼层
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>


#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("测试", 242, 200, 220, 180)
$Label1 = GUICtrlCreateLabel("帐套号", 16, 32, 48, 17)
$Label2 = GUICtrlCreateLabel("用户号", 16, 72, 40, 17)
$Label3 = GUICtrlCreateLabel("测试密码", 16, 112, 60, 17)
$Button1 = GUICtrlCreateButton("测试", 16, 154, 75, 25, 0)
$Combo1 = GUICtrlCreateCombo("0", 72, 24, 121, 25)
GUICtrlSetData(-1, "1|2|3", "")
$Combo2 = GUICtrlCreateCombo("1", 72, 64, 121, 25)
GUICtrlSetData(-1, "2|3|4|5", "")
$Combo3 = GUICtrlCreateCombo("111111", 72, 104, 121, 25)
GUICtrlSetData(-1, "123456", "")
$Button2 = GUICtrlCreateButton("退出", 128, 154, 89, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

If ProcessExists("CAClient.exe") = 0 Then
        Run("D:\CW400\CA\CaClient\CAClient.exe")
EndIf
$i = GUICtrlRead($Combo1)
$j = GUICtrlRead($Combo2)
$k = GUICtrlRead($Combo3)
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $Button2, $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        $i = GUICtrlRead($Combo1)
                        $j = GUICtrlRead($Combo2)
                        $k = GUICtrlRead($Combo3)
                        Run("D:\CW400\zw\zw_app.exe", "D:\CW400\zw")
                        Sleep(1000)
                        WinWaitActive("注册", "会计核算与管理系统")
                        ControlCommand("注册", "会计核算与管理系统", "ComboBox1", "SetCurrentSelection", $i)
                        ControlSetText("注册", "会计核算与管理系统", "Edit1", "00" & $j)
                        ControlSetText("注册", "会计核算与管理系统", "Edit2", $k)
                        ControlClick("注册", "会计核算与管理系统", "Button11")
                        If WinWaitActive("注册", "用户口令不正确!") Then
                                ProcessClose("zw_app.exe")
                        EndIf

        EndSwitch
WEnd

估计是等待某个窗口的出现。多检查窗口的信息是否有错。

[ 本帖最后由 顽固不化 于 2009-3-17 14:24 编辑 ]
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-19 11:04 , Processed in 0.071679 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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