本文来源吾爱破解论坛
https://blog.csdn.net/SHIGUANGTUJING/article/details/101159706
有点少哈,那就再贴个代码
# -*- coding: utf-8 -*-
import ctypes, time, signal, psutil, os
import tkinter as tk
RECVTEXTMSG_CALLBACK = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_wchar_p, ctypes.c_wchar_p)
RECVPAYMSG_CALLBACK = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_wchar_p, ctypes.c_wchar_p, ctypes.c_wchar_p)
# 初始化SDK
class WXSDK():
# 引入动态链接库
def __init__(self):
self.sdk = ctypes.CDLL("WeChatSDK.dll")
# 初始化接口
def WXOpenWechat(self):
self.pid = self.sdk.WXOpenWechat()
# 多开模块
def Open(num):
wxsdk = WXSDK()
for x in range(0,num):
try:
pid = wxsdk.WXOpenWechat()
# 判断是否打开成功如果PID为空则死循环(可能会死循环)
while(pid == 0):
pid = wxsdk.WXOpenWechat()
time.sleep(0.5)
time.sleep(0.8)
except:
pass
# 结束进程模块
def kill():
# 定义PID字典
pid_dict = {}
# 获取所有PID
pids = psutil.pids()
for pid in pids:
p = psutil.Process(pid)
pid_dict[pid]=p.name()
for t in pid_dict.keys():
if pid_dict[t] == "WeChat.exe":
try:
os.kill(t,signal.SIGABRT)
except:
while True:
try:
os.kill(t, signal.SIGABRT)
break
except:
continue
# 1.实例化object,建立窗口
window = tk.Tk()
# 2.给窗口可视化title
window.title("微信多开 2.0")
# 3.设置图标
# window.iconbitmap('1.ico')
# 4.设置窗口大小(窗口居中)
sw = window.winfo_screenwidth()
sh = window.winfo_screenheight()
ww = 300
wh = 300
x = (sw - ww) / 2
y = (sh - wh) / 2
window.geometry("%dx%d+%d+%d" % (ww, wh, x, y))
#锁定大小
window.maxsize(400, 200)
window.minsize(400, 200)
# 设置Label标签
lab = tk.Label(window, text='多开几个?', font=('', 14)).place(x=100, y=35)
# 设置text文本框标签
text = tk.Entry(window, text="2", font=14, textvariable="text")
text.pack()
# 改变text文本框位置
text.place(x=200,y=33,width=50,height=30)
# 俩按钮执行函数
def Open_Wechat():
# 给上面For循环的值,int型
Open(int(text.get()))
def Close_Windows():
kill()
# 俩按钮并设置位置
open_wechat = tk.Button(window, text='立即多开', width=15, height=2, command=Open_Wechat).place(x=50, y=100)
window_close = tk.Button(window, text='关闭全部', width=15, height=2, command=Close_Windows).place(x=200, y=100)
# 循环显示窗口
tk.mainloop()
版权声明:
本站所有资源均为站长或网友整理自互联网或站长购买自互联网,站长无法分辨资源版权出自何处,所以不承担任何版权以及其他问题带来的法律责任,如有侵权或者其他问题请联系站长删除!站长QQ754403226 谢谢。
- 上一篇: 学习Python分享——自助结算
- 下一篇: qq空间批量点赞