Putting AHK in Tray notification area - but as an executable button

Discuss Autohotkey related topics here. Not a place to share code.
Forum rules
Discuss Autohotkey related topics here. Not a place to share code.
User avatar
A Keymaker
Posts: 461
Joined: 31 May 2022, 13:46
Location: Donjon du Château de Mérovingien

Putting AHK in Tray notification area - but as an executable button

Post by A Keymaker » 21 Aug 2023, 04:47

Is there some way an AHK file or LNK leading to it can be placed permanently in the Tray notification area of Windows 10- but in a way that it would behave like some EXE pinned to Taskbar [i.e. in a permanent way] ?

Or maybe some other script file?
Last edited by A Keymaker on 22 Sep 2023, 01:49, edited 2 times in total.

ahk7
Posts: 591
Joined: 06 Nov 2013, 16:35

Re: Putting AHK in Tray notification area - but as an executable button

Post by ahk7 » 23 Aug 2023, 11:56

Broad question, broad answer:

Yes, you can replace the standard tray menu with your own and how it should respond to clicks - see
https://www.autohotkey.com/docs/v1/lib/Menu.htm#Click
One click to go to a label (menu handler), and in that label you can do what you want of course

User avatar
A Keymaker
Posts: 461
Joined: 31 May 2022, 13:46
Location: Donjon du Château de Mérovingien

Re: Putting AHK in Tray notification area - but as an executable button

Post by A Keymaker » 22 Sep 2023, 01:54

Good to know, thank you

But for my purposes this would not work because the goal is to have always visible fail-safe / panic button that fires a script which kills [in many ways] whatever scripts are running in a given moment- which sometimes I have to press quickly multiple times to break some loop that causes an AHK file to be re-opened or e.g. CMD windows keep opening themselves

User avatar
A Keymaker
Posts: 461
Joined: 31 May 2022, 13:46
Location: Donjon du Château de Mérovingien

Re: Putting AHK in Tray notification area - but as an executable button

Post by A Keymaker » 20 Jan 2024, 04:56

So does any one has any ideas about how to insert some script into the Tray and make it stay there as an always accessible icon, even if its execution will kill or running scripts system wide?

ahk7
Posts: 591
Joined: 06 Nov 2013, 16:35

Re: Putting AHK in Tray notification area - but as an executable button

Post by ahk7 » 20 Jan 2024, 10:45

If you want a tray icon to be always visible e.g. not having to click the ^ in tray area, you can just drag the icon to the taskbar and it will place it in the visible area. Probably better would be to setup a hotkey to kill all scripts which is probably faster to access than grabbing for the mouse, moving to tiny tray icon area and clicking.

Post Reply

Return to “General Discussion”