heavenm 发表于 2012-4-18 04:59:50

网维大师自动安装问题,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

heavenm 发表于 2012-4-18 05:00:45

第一次可以但是第二次的句柄不知道为什么前面会加一个0

heavenm 发表于 2012-4-18 05:07:51

{:face (319):}
纠结啊

happytc 发表于 2012-4-18 06:00:59

网维下载
heavenm 发表于 2012-4-18 04:59 http://www.autoitx.com/images/common/back.gif

我不能运行你的代码,没有_WinHandle函数!就没有再仔细看下去了

huangke 发表于 2012-4-18 09:24:29

WinGetHandle 这个都不可以么?

heavenm 发表于 2012-4-18 11:53:07

我不能运行你的代码,没有_WinHandle函数!就没有再仔细看下去了
happytc 发表于 2012-4-18 06:00 http://autoitx.com/images/common/back.gif


   这个函数我删除了,换成_Check了

502762378 发表于 2012-4-18 15:04:10

没办法测试,看到老板相同的名头进来顶下

XiaoFang 发表于 2012-4-23 10:09:11

{:face (396):}你们说的什么东西 啊
页: [1]
查看完整版本: 网维大师自动安装问题,AU3的问题么,句柄前会加0