|
本帖最后由 求道者 于 2017-5-27 21:14 编辑
- #NoTrayIcon ;隐藏图标
- if not A_IsAdmin ;查询是否具有管理员权限
- {
- Run *RunAs "%A_AhkPath%" ; 需要 v1.0.92.01+
- ExitApp
- }
- top: ;标签top
- WinWait, ahk_class Shell_TrayWnd ;等待ahk_class为Shell_TrayWnd的任务栏窗口开启
- SendMessage, 1466, , , , ahk_class Shell_TrayWnd ;什么用不知道但是用SendMessage向ahk_class为Shell_TrayWnd的任务栏窗口发送1466的Msg
- WinWaitClose, ahk_class Shell_TrayWnd ;等待ahk_class为Shell_TrayWnd的任务栏窗口关闭
- Goto, top ;跳转到名为top的标签 循环用
复制代码
神TM写出来了
但是感觉很不优雅
Goto这种东西![](static/image/smiley/default/shutup.gif)
说起来如果是用这个脚本的话……
那基本就一定要进程常驻了
这样的话把快捷键移植过来如何?
反正快捷键也是要进程常驻的
- ;#NoTrayIcon ;隐藏图标
- if not A_IsAdmin ;查询是否具有管理员权限
- {
- Run *RunAs "%A_AhkPath%" ; 需要 v1.0.92.01+
- ExitApp
- }
- Loop ;循环
- {
- IfWinExist, ahk_class Shell_TrayWnd ;判断是否存在ahk_class为Shell_TrayWnd的任务栏窗口
- {
- SendMessage, 1466, , , , ahk_class Shell_TrayWnd ;什么用不知道但是用SendMessage向ahk_class为Shell_TrayWnd的任务栏窗口发送1466的Msg
- WinWaitClose, ahk_class Shell_TrayWnd ;等待ahk_class为Shell_TrayWnd的任务栏窗口关闭
- }
- /* ;这个去掉的话底层实现是否没变?
- else ;否则
- {
- WinWait, ahk_class Shell_TrayWnd ;等待ahk_class为Shell_TrayWnd的任务栏窗口开启
- }
- */
- }
复制代码 这个大概就是更为现代风的代码样式了吧
|
|