Select Custom AutoHotKey Tray Icon from .ico file

2.7k views Asked by At

I have a functioning AHK script, and I want to assign a custom icon to it in the toolbar, I have a .ico file that I created that has the icon that i want to use. I can use the default (first) page in the .ico file just fine, but I need to use the second one. How do I do this? This is the troublesome line of code

Menu, Tray, Icon, \\volvo\users\pleavitt\Documents\Paul\Interface\Custom Icons\T-CheckIcon.ico,1,1

If I change the first "1" at the end of the code to a "2" it throws an error, but from this webpage I thought that that is what I was supposed to do.

In conclusion, I want to be able to select a page from the .ico file to use as the tray icon for my AHK script. thanks! Paul

1

There are 1 answers

0
Joe DF On

Menu

Documentation: http://ahkscript.org/docs/commands/Menu.htm


Menu, Tray, FileName [, IconNumber, IconWidth]
IconNumber and IconWidth are optional.
I am unsure that it supports Files on a network, i.e. \\path\to\file.ico.

Try copying it to the script's directory, and use the relative path like so :
Menu, Tray, Icon, %A_ScriptDir%\T-CheckIcon.ico

NB: Be sure to use the latest version of AutoHotkey.