主进程退出后,附加进程会卡住#Region ;**** 参数创建于 ACNWrapper_GUI ****
#PRE_icon=C:\Windows\syswow64\SHELL32.dll|-28
#PRE_UseX64=n
#PRE_Res_requestedExecutionLevel=None
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <WinAPI.au3>
#include <WinAPIProc.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$LianWoPid = Run(@ScriptDir&'\LianWoAuthC.exe')
Sleep(1000)
$LianWoAuthC = _SI_EnumProcessWindows($LianWoPid, 'LianWo')
If @error Then Exit
$GUI_WEIXIN = GUICreate('wx', 150, 150, 325, 401, $WS_POPUP)
GUISetBkColor(0x000)
_WinAPI_SetParent($GUI_WEIXIN, $LianWoAuthC)
GUISetState(@SW_SHOW)
AdlibRegister('_EXIT')
Do
Sleep(100)
Until ProcessExists($LianWoPid) == 0
Func _EXIT()
If ProcessExists($LianWoPid) == 0 Then
Exit
EndIf
EndFunc ;==>_EXIT
Func _SI_EnumProcessWindows($__process, $__parameter = Default)
$__iPid = ProcessExists($__process)
If $__iPid == 0 Then Return SetError(1, 0, 'Unknown PID');进程错误
Switch $__parameter
Case Default
$__visible = True
Case Else
$__visible = False
EndSwitch
$__EnumThreadWindows = _WinAPI_EnumProcessWindows($__iPid, $__visible);窗口列表
If Not IsArray($__EnumThreadWindows) Then Return SetError(1, 0, 'Unknown Windows')
If $__visible = True Then Return $__EnumThreadWindows[1][0]
ReDim $__EnumThreadWindows[UBound($__EnumThreadWindows)][6]
For $i = 1 To $__EnumThreadWindows[0][0]
If StringRegExp($__EnumThreadWindows[$i][1], $__parameter) Then Return $__EnumThreadWindows[$i][0]
Next
Return SetError(1, 0, 'Unknown PID')
EndFunc ;==>_SI_EnumProcessWindows
链接:http://pan.baidu.com/s/1pL6rYen 密码:xxmd
客户端 |