#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[1][0]
Else
Exit
EndIf
;If WinWait($PHandle[1][0],'sdasdasd') Then MsgBox(0, '', $PHandle[1][0])
;_ArrayDisplay($PHandle, '_WinAPI_EnumProcessWindows')
;MsgBox(0, '', WinGetText($PHandle[1][0]))
;MsgBox(0, '', WinGetText($PHandle[1][0]))
;ControlCommand($PHandle[1][0], '', 'Button1', "Check", "")
_Check($PHandle[1][0], '欢迎使用 网维大师蝌蚪娱乐平台 安装向导', "Button1")
Sleep(2000)
MsgBox(0, '', $_PHandle)
_Check($PHandle[1][0], '安装类型', "Button7")
Exit
Func _Check($C_Handle, $C_Content, $C_ID)
Local $strin
;~ $PHandle = _WinAPI_EnumProcessWindows($Pid)
;~ $_PHandle = $PHandle[1][0]
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