Selecting a page within a .ico file to use as tray icon

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
PaulLeavitt
Posts: 58
Joined: 21 Oct 2014, 10:04

Selecting a page within a .ico file to use as tray icon

13 Jan 2015, 13:21

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

Code: Select all

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
MJs
Posts: 454
Joined: 23 Sep 2014, 03:29

Re: Selecting a page within a .ico file to use as tray icon

13 Jan 2015, 16:13

is the error can't load the icon?
can you do that? get the second (icon, page?...), may be my information is wrong
since I think that changing the IconNumber applies to a resource files not to .ico file
I could be wrong if an icon file can have more then one icon, not the change of colors and dimensions of the same icon
User avatar
PaulLeavitt
Posts: 58
Joined: 21 Oct 2014, 10:04

Re: Selecting a page within a .ico file to use as tray icon

14 Jan 2015, 12:26

Here's the error I get.

Image

This line of code is where the trouble is.

Code: Select all

Menu, Tray, Icon, \\volvo\users\pleavitt\Documents\Paul\Interface\Custom Icons\T-CheckIcon.ico,2,1
After the file name, where the ,2,1 is, if I change the 2 to a 1, then it works.
Thanks!
Paul
lexikos
Posts: 9690
Joined: 30 Sep 2013, 04:07
Contact:

Re: Selecting a page within a .ico file to use as tray icon

14 Jan 2015, 20:49

ICO files only support a single icon group, containing images in different sizes and colour depths representing the same icon. They do not support multiple icon groups. The IconNumber parameter is for specifying an icon group in an executable file. (The data format of a single icon group resource is almost identical to the data format of an ICO file.)

It is possible to create a "resource only" DLL which contains multiple icons. These commonly use the ".icl" filename extension. I use @icon sushi to edit ICO files, and I believe it can also create ICL files. I think SKAN also posted a script somewhere for creating a resource-only DLL.
User avatar
PaulLeavitt
Posts: 58
Joined: 21 Oct 2014, 10:04

Re: Selecting a page within a .ico file to use as tray icon

12 Feb 2015, 12:08

Ohhhhhh. Ok, that makes sense Lexikos. Thanks!

So I'm pretty naive when it comes to things like .DLL files and .icl's. I basically want to have a repository in the folder where my Macro's are stored that has a number of different icons that I can assign to various scripts so that the tray icons are distinguishable. Would I do this with a DLL or something? Just have all the individual icons in a folder? How would you recommend going about this?
Thanks!
Paul
lexikos
Posts: 9690
Joined: 30 Sep 2013, 04:07
Contact:

Re: Selecting a page within a .ico file to use as tray icon

12 Feb 2015, 16:22

Go with the easiest method that works; i.e. ICO files.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Draken, oktavimark and 296 guests