用于一键拦截弹出广告,使用方法:Ctrl+Alt+Shift+左键点击
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. #SingleInstance,force #Persistent Menu, Tray, Icon, Shell32.dll, 174 if !fileexist("弹窗.ini") FileAppend,,弹窗.ini IniRead,out,弹窗.ini,Section1 SetTimer ,关闭弹窗,1000 关闭弹窗: loop ,parse,out,`n,`r { K:=RegExReplace(A_LoopField,"=.*?$") ;用户自定义变量的key tmp:=RegExReplace(A_LoopField,"^.*?=") ;"^.*?=|=.*?$") v:=RegExReplace(tmp,"=.*?$") ;~ MsgBox % strsplit(tmp,"=").maxindex() ;含有等号的个数; ;~ if (strsplit(tmp,"=").maxindex()>1) ;~ { e:=RegExReplace(tmp,".*?=") ;~ e:=RegExReplace(A_LoopField,"^.*?=.*?=") ;用户自定义变量的value ;~ MsgBox %k%----%v%----------%e% ;~ WinGetPos, X, Y, Width, Height,%k% ahk_class %v% ahk_exe %e% ;~ if (x>1300) && (y>500) ;有些窗口很操蛋,直接显示在屏幕中间,故不能这样搞 WinClose,%k% ahk_class %v% ahk_exe %e% ;~ MsgBox WinClose,ahk_class %v% ahk_exe %e% ;~ } ;~ else ;~ { ;~ e:=RegExReplace(tmp,".*?=") ;~ MsgBox %k%----%v% ;~ WinClose,%k% ahk_class %v% ahk_exe %e% ;~ } } ^!+LButton:: MouseGetPos, Ox, Oy, Owin, Octr_class ControlGetText, Octr_text, %Octr_class%, ahk_id %Owin% ControlGet, Octr_id, Hwnd, , %Octr_class%, ahk_id %Owin% WinGetClass,窗口类,ahk_id %Owin% WinGetTitle,窗口标题,ahk_id %Owin% winget,进程名,ProcessName,ahk_id %Owin% b:=窗口类 a:=窗口标题 c:=进程名 MsgBox, 4,, 确定要关闭: %a%---%b%---%c%吗?(press Yes or No) IfMsgBox No return ;加return相当于Exit FileAppend, `n%a%=%b%=%c%,弹窗.ini Reload return
用于一键拦截弹出广告,使用方法:Ctrl+Alt+Shift+左键点击
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
有想法,支持一下。
有想法,支持一下。