Created
February 1, 2021 21:40
-
-
Save tdalon/38526a2354864510a4d1de39a8b1757c to your computer and use it in GitHub Desktop.
NotifyTrayClick AutoHotkey function to customize tray icon click actions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NotifyTrayClick(P*) { ; v0.41 by SKAN on D39E/D39N @ tiny.cc/notifytrayclick | |
Static Msg, Fun:="NotifyTrayClick", NM:=OnMessage(0x404,Func(Fun),-1), Chk,T:=-250,Clk:=1 | |
If ( (NM := Format(Fun . "_{:03X}", Msg := P[2])) && P.Count()<4 ) | |
Return ( T := Max(-5000, 0-(P[1] ? Abs(P[1]) : 250)) ) | |
Critical | |
If ( ( Msg<0x201 || Msg>0x209 ) || ( IsFunc(NM) || Islabel(NM) )=0 ) | |
Return | |
Chk := (Fun . "_" . (Msg<=0x203 ? "203" : Msg<=0x206 ? "206" : Msg<=0x209 ? "209" : "")) | |
SetTimer, %NM%, % (Msg==0x203 || Msg==0x206 || Msg==0x209) | |
? (-1, Clk:=2) : ( Clk=2 ? ("Off", Clk:=1) : ( IsFunc(Chk) || IsLabel(Chk) ? T : -1) ) | |
Return True | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Source: https://www.autohotkey.com/boards/viewtopic.php?t=81157 by Skan
How to use: see https://tdalon.blogspot.com/2021/02/autohotkey-custom-tray-icon-clicks.html