#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 编辑 ] |