绿色风's Blog
专注AutoIT(Au3)
  • 首页
  • 流●年
  • 笔●记
    • 学习随记
    • 源码示例
  • 脚●本
    • UDF(收集)
    • 工作室UDF
    • 工具●教程
    • 教程之GDI
  • 作●品
  • 下●载
  • 情怀ExcelTip
5月22017

PC版微信多开

作者:haijie1223   发布:2017-5-2 15:09 Tuesday   分类:源码示例   阅读:16999次   评论:1条  

#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 />




本文固定链接: http://www.jianyiit.com/post-267.html

blogger
该日志由 haijie1223 于2017-5-2 15:09 Tuesday发表在 源码示例 分类下。
版权所有:《绿色风's Blog》 → 《PC版微信多开》;
除特别标注,本博客很多文章均为原创. 互联分享,尊重版权,转载请以链接形式标明本文地址;
本文标签:

扫描二维码,在手机上阅读
上一篇::获取打开的IE窗口的句柄与TAB标题
下一篇:AU3获取内存和CPU占用

热门文章

相关文章

  • 获取进程列表路径
  • Au3获取桌面图标名称与坐标
  • PC版微信多开
  • AU3打印预览源码示例
  • AU3小游戏 - 撸杆过桥
评论列表 ↓
呦,果断人中龙凤! David      2017-06-26 14:57 @回复
非常好用谢谢!!
取消回复

发表评论

亲,头像对么?

12 + 90 =

提交中,请稍候……


木有头像就木JJ啦!还木有头像吗?点这里申请属于你的个性Gravatar头像吧!


    站点统计
    • 运行时间: 20254 天
    • 日志总数: 365 篇
    • 评论数量: 7238 条
    • 微语数量: 6 条
    • 附件总量: 388 件
  • 逝出的青春

  • 打赏"绿色风"



      扫码关注本站公众号 可搜本站内容

  • Autoit V3 脚本交流群

      常驻群1:905774875
      常驻群2:40672266


  • 链接

    • AU3中文论坛
    • Excel资料库
    • 完美者博客
    • 顺网小哥'S Blog
    • 猛牛哥的博客
    • 网吧系统下载
  • 分类

    • 流●年(66)
    • 笔●记(0)
    • 脚●本(0)
    • 作品(21)
    • 学习随记(51)
    • 源码示例(68)
    • UDF(收集)(26)
    • 工作室UDF(30)
    • 工具●教程(62)
    • 教程之GDI(24)
Copyright © 2013 绿色风's Blog. Powered by emlog. Theme by 射雕天龙. 鄂ICP备2021011689号-1 鄂公网安备42102302000078号 sitemap