网维大师自动安装问题,AU3的问题么,句柄前会加0
本帖最后由 heavenm 于 2012-4-18 11:47 编辑网维下载
http://down.icafe8.com/archive/Icafe_Server7.1.3.0.exe#include <Process.au3>
#include <Array.au3>
#include <WinAPIEx.au3>
;Opt("WinSearchChildren", 1)
Dim $Title = '顺网网维大师蝌蚪娱乐平台V7.1.3.0 - 安装'
Local $Install, $i,$_PHandle
Dim $TimeOut = 15
;_IcafePatch()
Global $Pid = Run('NBMSClient.exe')
If WinWait($Title, '', $TimeOut) Then
Sleep(100);必须等待否则会出错
$PHandle = _WinAPI_EnumProcessWindows($Pid)
$_PHandle = $PHandle
Else
Exit
EndIf
;If WinWait($PHandle,'sdasdasd') Then MsgBox(0, '', $PHandle)
;_ArrayDisplay($PHandle, '_WinAPI_EnumProcessWindows')
;MsgBox(0, '', WinGetText($PHandle))
;MsgBox(0, '', WinGetText($PHandle))
;ControlCommand($PHandle, '', 'Button1', "Check", "")
_Check($PHandle, '欢迎使用 网维大师蝌蚪娱乐平台 安装向导', "Button1")
Sleep(2000)
MsgBox(0, '', $_PHandle)
_Check($PHandle, '安装类型', "Button7")
Exit
Func _Check($C_Handle, $C_Content, $C_ID)
Local $strin
;~ $PHandle = _WinAPI_EnumProcessWindows($Pid)
;~ $_PHandle = $PHandle
While 1
ConsoleWrite($C_Handle & @CR)
If StringInStr(WinGetText(HWnd($C_Handle), ''), $C_Content) Then
;MsgBox(0, '',$string )
ExitLoop
EndIf
Sleep(1000)
;~ ;MsgBox(0, $C_Handle, WinGetText(HWnd ($C_Handle)))
ConsoleWrite(WinGetText(HWnd($C_Handle), ''))
WEnd
ControlFocus($C_Handle, $C_Content, $C_ID)
ControlCommand($C_Handle, $C_Content, $C_ID, "Check", "")
EndFunc ;==>_Check 第一次可以但是第二次的句柄不知道为什么前面会加一个0 {:face (319):}
纠结啊 网维下载
heavenm 发表于 2012-4-18 04:59 http://www.autoitx.com/images/common/back.gif
我不能运行你的代码,没有_WinHandle函数!就没有再仔细看下去了 WinGetHandle 这个都不可以么? 我不能运行你的代码,没有_WinHandle函数!就没有再仔细看下去了
happytc 发表于 2012-4-18 06:00 http://autoitx.com/images/common/back.gif
这个函数我删除了,换成_Check了 没办法测试,看到老板相同的名头进来顶下 {:face (396):}你们说的什么东西 啊
页:
[1]