5月22017
PC版微信多开
#RequireAdmin
#PRE_UseX64=n
#QQ群:477266297
#include <array.au3>
#include <Winapi.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPISys.au3>
Opt("GUIOnEventMode", 1)
Global $WeChatPath = ''
_GetWeChatPath()
#Region ### START Koda GUI section ### Form=
Global $MainForm = GUICreate("MainForm", 280, 200, -1, -1)
Global $Btn_Start = GUICtrlCreateButton('AddNew', 5, 5, 80, 21)
Global $Btn_Multi = GUICtrlCreateButton('Multi', 5, 35, 80, 21)
Global $Btn_CloseAll = GUICtrlCreateButton('CloseAll', 5, 65, 80, 21)
Global $Ipt_Num = GUICtrlCreateInput('5', 105, 35, 80, 21)
GUISetState(@SW_SHOW)
GUISetOnEvent(-3, '_Exit')
GUICtrlSetOnEvent($Btn_Start, '_SetParent')
GUICtrlSetOnEvent($Btn_Multi, '_MultiStart')
GUICtrlSetOnEvent($Btn_CloseAll, '_CloseAll')
#EndRegion ### END Koda GUI section ###
While 1
Sleep(100)
WEnd
Func _Exit()
Exit
EndFunc ;==>_Exit
Func _CloseAll()
Local $aWindows = _WinAPI_EnumWindowsTop()
For $j = 1 To $aWindows[0][0]
If $aWindows[$j][1] = 'WeChatMainWndForPC' Or $aWindows[$j][1] = 'WeChatLoginWndForPC' Then WinClose($aWindows[$j][0])
Next
EndFunc ;==>_CloseAll
Func _MultiStart()
Local $Number = GUICtrlRead($Ipt_Num)
If $Number > 0 Then
GUICtrlSetState($Btn_Multi, $GUI_DISABLE)
For $i = 1 To $Number
Run($WeChatPath)
WinWait('[CLASS:WeChatLoginWndForPC]')
Local $aWindows = _WinAPI_EnumWindowsTop()
For $j = 1 To $aWindows[0][0]
If $aWindows[$j][1] = 'WeChatMainWndForPC' Or $aWindows[$j][1] = 'WeChatLoginWndForPC' Then _WinAPI_SetParent($aWindows[$j][0], $MainForm)
Next
;~ WinExists('[CLASS:WeChatLoginWndForPC]')
Next
_OutParent()
GUICtrlSetState($Btn_Multi, $GUI_ENABLE)
EndIf
EndFunc ;==>_MultiStart
Func _GetWeChatPath()
$WeChatPath = RegRead('HKEY_CURRENT_USER\Software\Tencent\WeChat', 'InstallPath')
$WeChatPath &= '\WeChat.exe'
If Not FileExists($WeChatPath) Then Exit MsgBox(0, 'Error', '系统中未安装PC版微信,程序退出!', -1, 0)
EndFunc ;==>_GetWeChatPath
Func _SetParent()
GUICtrlSetState($Btn_Start, $GUI_DISABLE)
Local $aWindows = _WinAPI_EnumWindowsTop()
For $i = 1 To $aWindows[0][0]
If $aWindows[$i][1] = 'WeChatMainWndForPC' Or $aWindows[$i][1] = 'WeChatLoginWndForPC' Then _WinAPI_SetParent($aWindows[$i][0], $MainForm)
Next
Run($WeChatPath)
WinWait('[CLASS:WeChatLoginWndForPC]')
_OutParent()
GUICtrlSetState($Btn_Start, $GUI_ENABLE)
EndFunc ;==>_SetParent
Func _OutParent()
Local $List = _WinAPI_EnumChildWindows($MainForm)
For $i = 1 To $List[0][0]
If $List[$i][1] = 'WeChatMainWndForPC' Or $List[$i][1] = 'WeChatLoginWndForPC' Then _WinAPI_SetParent($List[$i][0], 0)
Next
EndFunc ;==>_OutParent```
<br />
扫描二维码,在手机上阅读
木有头像就木JJ啦!还木有头像吗?点这里申请属于你的个性Gravatar头像吧!
非常好用谢谢!!