http://bbs.cfan.com.cn/thread-1124060-1-1.html
以下是ahk的脚本,千千需要开启全局快捷键
#SingleInstance
#Persistent
Menu, Tray, NoStandard
Menu, Tray, Icon, Shell32.dll, 168
menu, tray, add, 开始监视
menu, tray, add, 停止监视
mykey = !z
mytitle = 视频, 56.com, 优酷, 酷6, 我秀, seehaha, 6间房, 菠萝网, 第九频道, mofile, OMYTVS, 爆米花, 播客, video, woaide and WinGetClass ;标题关键词
myexplorerclass = Internet Explorer, TheWorld_Frame, IEFrame, 360se_Frame, OpWindow, TT_WebCtrl, ThunderRT6MDIForm, TfrmMain.UnicodeClass, MozillaUIWindowClass, Maxthon2_Frame, Chrome_WidgetWin_0, Afx:400000:8:10011:0:13805c7, Chaosu, SE_SogouExplorerFrame ;浏览器窗口类名(ahk_class)
Goto, start
Return
start:
开始监视:
statu = 0
Loop
{
if stop = 1
ExitApp
WinGetActiveTitle, title
WinGetClass, class, %title%
if title contains %mytitle% And if class Contains %myexplorerclass% ;检测关键词并判断是否在浏览器中
If statu = 0
{
send,%mykey%;全局快捷键,不建议用含*,!为ALT,^为CTRL
statu = 1
}
if title not contains %mytitle% And if class Contains %myexplorerclass%
If statu = 1
{
send, %mykey%
statu = 0
}
Sleep, 1000;暂停1s
}
Return
停止监视:
stop = 1
Return