ctypes摧毁弹窗

2021-03-07  本文已影响0人  BI罗
import ctypes

#摧毁弹窗
def worker():
    while True:
        title_list = ["DAX error", "timeout"]  # ["succeed","DAX error","timeout"]
        for title in title_list:
            sleep(2)
            wd = ctypes.windll.user32.FindWindowA(0, title.encode('gb2312'))
            ctypes.windll.user32.SendMessageA(wd, 0x0010, 0, 0)
        f12_state = win32api.GetAsyncKeyState(123)  # 123-f12的键位码,f12退出循环
        if f12_state == 1:
            break
    return


def AutoCloseMessageBoxW(text, title):
    ctypes.windll.user32.MessageBoxA(0, text.encode('gb2312'), title.encode('gb2312'))

不过更喜欢PySimpleGUI制作的几秒后消失的弹窗

上一篇下一篇

猜你喜欢

热点阅读