Using dll embedded icons

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
nerdweed
Posts: 648
Joined: 25 Feb 2012 07:47

Using dll embedded icons

Post by nerdweed »

How can we use icons embedded within a dll in XY

Normally, it is <full_path_to_dll>, <index_of_resource>

However; I am unable to get this working. This may be possibly a bug

binocular222
Posts: 1419
Joined: 04 Nov 2008 05:35
Location: Win11, Win10, 100% Scaling

Re: Using dll embedded icons

Post by binocular222 »

I asked this before, Don said impossible. For dll with multiple icons, only the 1st icon is returned
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Using dll embedded icons

Post by bdeshi »

You can use embedded icons at least in CTB icon and scripted menu captions. Like this:

Code: Select all

"<path_to_resource> /<icon_index>"
"%SystemRoot%\SYSTEM32\shell32.dll /163"

I'd asked for ~it too: http://www.xyplorer.com/xyfc/viewtopic. ... ilit=+icon
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

binocular222
Posts: 1419
Joined: 04 Nov 2008 05:35
Location: Win11, Win10, 100% Scaling

Re: Using dll embedded icons

Post by binocular222 »

Whao, Bravo!
Should do a cleanup on my <xyicons> now

P.S :eh: XY seems to retrieve the wrong icon ID in sheel32.dll
i.e: %SystemRoot%\SYSTEM32\shell32.dll /181 is computer icon, however, XY shows as DVD icon (ID=222)
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Using dll embedded icons

Post by bdeshi »

What OS are you on? On my system 181 == cdrom icon.

aside from that, Here's the explanation.
======
Icon_IDs.png
Icon_IDs.png (4.96 KiB) Viewed 2265 times
#181 is the icon's ID in shell32.dll. But XY uses the ordinal position (index) of the icon.[/size]


Though shell32.dll has icon IDs up to #63011,
Max_ID.png
Max_ID.png (4.5 KiB) Viewed 2265 times
there are actually only 306 icons in total when counted.

=====

Here's what you should do:

Start counting from the first icon, and you'll see that the 181st icon (not ID #181) is indeed the icon you see.

Open XY's property info pane for shell32.dll, and increase the icon counter to 181 (this index number is what XY uses, not the ID)
IconIndex.png
IconIndex.png (6.93 KiB) Viewed 2265 times
I hope I explained clearly!
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

binocular222
Posts: 1419
Joined: 04 Nov 2008 05:35
Location: Win11, Win10, 100% Scaling

Re: Using dll embedded icons

Post by binocular222 »

Any easier method? Browsing icon ONE-BY-ONE in XY properties panel is impractical.

P.S: Previously, I used Nirsoft's Icon Extract to view the ID
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Using dll embedded icons

Post by bdeshi »

binocular222 wrote:Browsing icon ONE-BY-ONE in XY properties panel is impractical.
you can click-and-hold the arrows there...

found a solution: http://www.vlsoftware.net/icons-from-file/download.html
2015-01-11_140244.png
2015-01-11_140244.png (41.92 KiB) Viewed 2256 times
selected icon's index is shown in the statusbar as <index>:<total> (hilited in green)

It's an innosetup installer, extractable with Universal Extractor, and the program itself is portable.

It's initially in Ukrainian, select the green tick button in the toolbar, pick the first menu item, and choose english.
It also tries to go online, probably to check for updates, but I ran it inside Sandboxie...
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

binocular222
Posts: 1419
Joined: 04 Nov 2008 05:35
Location: Win11, Win10, 100% Scaling

Re: Using dll embedded icons

Post by binocular222 »

Thanks, that works
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

nerdweed
Posts: 648
Joined: 25 Feb 2012 07:47

Re: Using dll embedded icons

Post by nerdweed »

Thanks. I hadn't managed to get it working in CTB either.
"<path_to_resource> /<icon_index>" works fine in CTB.

It would have been great if CFI supported it as well

Post Reply