美文网首页
ctypes摧毁弹窗

ctypes摧毁弹窗

作者: BI罗 | 来源:发表于2021-03-07 12:03 被阅读0次
    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制作的几秒后消失的弹窗

    相关文章

      网友评论

          本文标题:ctypes摧毁弹窗

          本文链接:https://www.haomeiwen.com/subject/upzeqltx.html