@
caixiexin chrome 标签页脚本
#NoEnv
#SingleInstance force
IniRead, doubleclick, settings.ini, option, doubleclick,Check
IniRead, scrolltab, settings.ini, option, scrolltab,Check
IniRead, rightclick, settings.ini, option, rightclick,Check
EmptyMem()
menu, tray, NoStandard
menu, tray, add, 退出
menu, tray, add ;分割线
menu, tray, add, 启用双击关闭标签页
menu, tray, add, 启用滚轮切换标签页
menu, tray, add, 启用右键关闭标签页
menu, tray, %doubleclick%, 启用双击关闭标签页
menu, tray, %scrolltab%, 启用滚轮切换标签页
menu, tray, %rightclick%, 启用右键关闭标签页
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
退出:
ExitApp
return
启用双击关闭标签页:
if doubleclick<>Check
{
menu, tray, Check, 启用双击关闭标签页
doubleclick=Check
}
Else
{
menu, tray, unCheck, 启用双击关闭标签页
doubleclick=unCheck
}
IniWrite, %doubleclick%, settings.ini, option, doubleclick
EmptyMem()
return
启用滚轮切换标签页:
if scrolltab<>Check
{
menu, tray, Check, 启用滚轮切换标签页
scrolltab=Check
}
Else
{
menu, tray, unCheck, 启用滚轮切换标签页
scrolltab=unCheck
}
IniWrite, %scrolltab%, settings.ini, option, scrolltab
EmptyMem()
return
启用右键关闭标签页:
if rightclick<>Check
{
menu, tray, Check, 启用右键关闭标签页
rightclick=Check
}
Else
{
menu, tray, unCheck, 启用右键关闭标签页
rightclick=unCheck
}
IniWrite, %rightclick%, settings.ini, option, rightclick
EmptyMem()
return
#IfWinActive ahk_class Chrome_WidgetWin_1
~$WheelDown::
~$WheelUp::
if scrolltab=Check
{
MouseGetPos,, ypos
If (ypos>40) Or (ypos<0)
Return
IfEqual,A_ThisHotkey,~$WheelDown, Send ^{PgDn}
Else Send ^{PgUp}
EmptyMem()
}
Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
~LButton::
if doubleclick=Check
{
MouseGetPos,xpos, ypos
WinGet,Mom,MinMax
If ((ypos>45)And(Mom<1))Or((ypos>28)And(Mom>0)) Or (ypos<0)
Return
If (A_PriorHotkey="~LButton") and (A_TimeSincePriorHotkey<200)
send {click middle}
EmptyMem()
}
Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
~RButton Up::
~RButton::
if rightclick=Check
{
MouseGetPos,xpos, ypos
WinGet,Mom,MinMax
If ((ypos>45)And(Mom<1))Or((ypos>28)And(Mom>0)) Or (ypos<0)
Return
if GetKeyState("1")
Return
IfEqual,A_ThisHotkey,~RButton, Send {Click Middle}
Else Send {Click middle}
EmptyMem()
}
Return
#IfWinActive
EmptyMem(PID="AHK Rocks"){
pid:=(pid="AHK Rocks") ? DllCall("GetCurrentProcessId") : pid
h:=DllCall("OpenProcess", "UInt", 0x001F0FFF, "Int", 0, "Int", pid)
DllCall("SetProcessWorkingSetSize", "UInt", h, "Int", -1, "Int", -1)
DllCall("CloseHandle", "Int", h)
}
任务栏鼠标滚轮调节音量 脚本
#If MouseIsOver("ahk_class Shell_TrayWnd")
WheelUp::Send {Volume_Up}
WheelDown::Send {Volume_Down}
MouseIsOver(WinTitle) {
MouseGetPos,,, Win
return WinExist(WinTitle . " ahk_id " . Win)
}
return