Google Chrome 没有“退出确认”的提示和按钮,求助 您所在的位置:网站首页 谷歌浏览器多窗口关闭提示 Google Chrome 没有“退出确认”的提示和按钮,求助

Google Chrome 没有“退出确认”的提示和按钮,求助

#Google Chrome 没有“退出确认”的提示和按钮,求助| 来源: 网络整理| 查看: 265

使用 AHK, 在 Chrome 中按下 alt+F4(或 ctrl+w 或其他退出键)时,给出弹窗,当选择 Yes 时,takkill 掉当前进程(Chrome)。

; 避免误退出 !F4:: { if (WinActive("ahk_exe chrome.exe")){ MsgBox, 4,, Would you like to exit (press yes) or return to menu (no)? `n(Press yes or no) IfMsgBox Yes { ; 弹窗显示要退出 ;MsgBox, 0,, Exiting ; 获取当前激活的窗口的进程名,并存放到变量 activeprocess WinGet, activeprocess, ProcessName, A ; 执行 taskkill 命令,并引用 activeprocess 变量 Run, %comspec% /c taskkill /f /im %activeprocess%,,hide return } else { return } } }

效果:

image

回车就退出,tab 键选 no,再回车,就取消。

上面的代码有 bug。效果不好。taskkill 太猛了,如果是资源管理器下,直接关闭资源管理器,任务栏都不见了。还是使用原有的 alt+F4 的关闭方式,同时为了避免循环调用自身,使用 $!F4 而非 !F4。

$!F4:: { if (WinActive("ahk_class MozillaWindowClass")){ MsgBox, 4,, Would you like to exit (press yes) or return to menu (no)? `n(Press yes or no) IfMsgBox Yes { ; 弹窗显示要退出 ;MsgBox, 0,, Exiting Send !{F4} return } else ; 不退出 { return } } ; 其他程序默认发送 alt+F4 按键 Send !{F4} return }

用白名单搜索这些解决办法很方便。搜索引擎黑白名单过滤,自定义搜索引擎 cse.google.com,customsearch.ai,黑白名单过滤插件 uBlacklist

reference 如何设置 Windows Terminal 退出不显示是否关闭所有标签的二次确认窗口? 问题求助❓ 我找到一个用 AHK 解决的方法: ; alt+F4 !F4:: { ;MsgBox "you pressed !F4" Run, %comspec% /c taskkill /f /im PDFXEdit.exe,,hide return } 其中的 PDFXEdit.exe 是 PDF-Xchange Editor,在关闭未保存的 PDF 文档前会给出提示,经测试,这段代码可以使用。 进程名,可以通过 AHK 的 Windows Spy 来定位,可以跟随鼠标显示窗口信息,得到 ahk_exe 就行了。 [image] 若要对当前所有激活的窗口生效,可以改为: !F4:: { ; 获取当前激活的窗口的进程名,并存放到变量 activeprocess WinGet, activeprocess, ProcessName, A ; 执行 taskkill 命令,并引用 activeprocess 变量 Run, %comspec% /c taskkill /f /im %activeprocess%,,hide …

https://www.reddit.com/r/AutoHotkey/comments/5tm7jm/best_alternative_to_a_yesno_msgbox_for_people/

AutoHotkey Community What's the purpose of the dollar sign in AHK script? - Ask for Help

What's the purpose of the dollar sign in AHK script? - posted in Ask for Help: I came across this post: http://www.autohotke...om-copied-text/   I am new to AHK, and I have never used a dollar sign in my AHK script, can you tell me when I should...



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有