: :办公软件 2019-10-07 18:14:40
# -*- 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()
TAG: 微信多开器,源码
10-12有道翻译源码JS版
10-03易语言源码批量添加注释,替换换行符
09-20智能风扇.c源码
09-18电子秤源码(stc15w408s)
08-23游戏图色脚本框架源码
08-23取机器码升级版,模块和源码
08-23红叶网络验证易语言对接源码
08-15图片修改2.4源码分享
08-15C# freemove源码分享
09-07C++的string的实现源码分析
12-11自动获取缩略图RiPro美化教程内含源码
10-15word循环插入文字 图片工具源码