Page 1 of 1
Column property to show number of sub-images in ICO file?
Posted: 04 Mar 2015 17:11
by kunkel321
It must be possible.... There is a TC plugin that somebody wrote a long time ago...
I remember that somebody recently posted a loonnnngggg list of Windows properties that can be used in xyCCs, but I can't find the list(?) I searched but couldn't find it. Also tried a Google search but it just yielded developer stuff... Thoughts?
Re: Column property to show number of sub-images in ICO file
Posted: 04 Mar 2015 17:23
by admin
Trivial, see
http://en.wikipedia.org/wiki/ICO_%28fil ... _structure
The number you want is at pos 4/5 (in real life always pos 4, never saw an icon with more than 256 images), just read it using a Custom Column with a script. Somebody here will show the way...
(Is this a deja-vu? It seems to me we did this before somewhere/when...)
Re: Column property to show number of sub-images in ICO file
Posted: 04 Mar 2015 17:29
by TheQwerty
Why not add ICO support to Get('CountIcons')?
Re: Column property to show number of sub-images in ICO file
Posted: 04 Mar 2015 17:31
by bdeshi
admin wrote:(Is this a deja-vu? It seems to me we did this before somewhere/when...)
Hah,
http://www.xyplorer.com/xyfc/viewtopic. ... 45#p101040 remember the dinosaur!
Re: Column property to show number of sub-images in ICO file
Posted: 04 Mar 2015 18:15
by TheQwerty
Code: Select all
Snip: CustomColumn 1
XYplorer 14.80.0235, 3/4/2015 12:12:41 PM
Action
ConfigureColumn
Caption
Icon Count
Type
3
Definition
$item = <cc_item>;
$v = Get('CountIcons', $item);
if ($v == '') {
if ($item LikeI '*.ico') {
$v = HexToDec(HexDump(ReadFile($item,'b', 2,,4),, 'r'));
}
}
return $v;
Format
2
Trigger
0
Item Type
0
Item Filter
ico;exe;dll;cpl;ocx;scr;icl;bpl;wlx;wfx;wcx;wdx;acm
The item filter is based on the documentation for Get('CountIcons') with the addition of ico.
Re: Column property to show number of sub-images in ICO file
Posted: 04 Mar 2015 18:33
by admin
TheQwerty wrote:Why not add ICO support to Get('CountIcons')?
Yeah!
PS: Next beta:
IconCount.png
Re: Column property to show number of sub-images in ICO file
Posted: 04 Mar 2015 19:10
by admin
This will do in 14.80.0239:
Code: Select all
Snip: CustomColumn 1
XYplorer 14.80.0239, 04.03.2015 19:09:58
Action
ConfigureColumn
Caption
Icon Count
Type
2
Definition
<get counticons <cc_item>>
Format
2
Trigger
0
Item Type
0
Item Filter
ico
Re: Column property to show number of sub-images in ICO file
Posted: 04 Mar 2015 19:46
by kunkel321
Cool thanks guys!
LOL. I remembered requesting the previous feature, but I'd forgotten about the dinosaur.
Question: Don, in your screenshot, "Custom Column 28: Icon Count" is the same setup used to extract the number of ICO files in a DLL. (With the exception of the 'item filter' of "ico.")
Will that cause a conflict, or does it mean that the same CC template can be used for each (number of icons in dll or number of images in ico)?
Re: Column property to show number of sub-images in ICO file
Posted: 04 Mar 2015 20:32
by admin
kunkel321 wrote:Question: Don, in your screenshot, "Custom Column 28: Icon Count" is the same setup used to extract the number of ICO files in a DLL. (With the exception of the 'item filter' of "ico.")
Will that cause a conflict, or does it mean that the same CC template can be used for each (number of icons in dll or number of images in ico)?
Yes, you can use the same column for all. Just take care that "ico" is mentioned in the filter among the other file types you are interested in.
Re: Column property to show number of sub-images in ICO file
Posted: 05 Mar 2015 19:21
by kunkel321
It works like a charm! Thanks for adding this Don!
Of course now I have to decide if my default columns should show ICO dimensions, or image counts.

(first world problem, lol)