Code: Select all
#If IsHomeKey()
LButton:: ToolTip
#If
IsHomeKey() {
MouseGetPos, , , WinId, ControlNN
if !InStr( ControlNN, "DirectUIHWND")
return 0
WinGet, Process, ProcessName, ahk_id %WinId%
if Process != iexplore.exe
return 0
return GetTextUnderMouse() = "create tabs (CTRL+T)" ? 1 : 0
}
GetTextUnderMouse() {
Static h
If !h
h := DllCall("LoadLibrary","Str","oleacc","Ptr")
If DllCall("oleacc\AccessibleObjectFromPoint"
, "Int64", DllCall("GetCursorPos","Int64*",pt)+pt
, "Ptr*", pacc, "Ptr", VarSetCapacity(varParent,8+2*A_PtrSize,0)*0+&varParent)=0
Acc:=ComObjEnwrap(9,pacc,1), Parent:=NumGet(varParent,8,"UInt")
try value := Acc.accValue(Parent)
if value =
try value := Acc.accName(Parent)
return value
}
Code: Select all
#If IsHomeKey()
LButton:: ToolTip
#If
IsHomeKey() {
MouseGetPos, , , WinId, ControlNN
if !InStr( ControlNN, "ToolbarWindow")
return 0
WinGet, Process, ProcessName, ahk_id %WinId%
if Process != iexplore.exe
return 0
return GetTextUnderMouse() = "Home" ? 1 : 0
}
GetTextUnderMouse() {
Static h
If !h
h := DllCall("LoadLibrary","Str","oleacc","Ptr")
If DllCall("oleacc\AccessibleObjectFromPoint"
, "Int64", DllCall("GetCursorPos","Int64*",pt)+pt
, "Ptr*", pacc, "Ptr", VarSetCapacity(varChild,8+2*A_PtrSize,0)*0+&varChild)=0
Acc:=ComObjEnwrap(9,pacc,1), child:=NumGet(varChild,8,"UInt")
try value := Acc.accValue(child)
if value =
try value := Acc.accName(child)
return value
}