Column property to show number of sub-images in ICO file?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
kunkel321
Posts: 664
Joined: 10 Jun 2012 03:45
Location: Near Seattle

Column property to show number of sub-images in ICO file?

Post by kunkel321 »

It must be possible.... There is a TC plugin that somebody wrote a long time ago...

Image

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?
ste(phen|ve) kunkel
Scaling: Main monitor 125%, Secondary monitor on the right 100%
OS: Win 10. XYplorer version: Latest beta, unless specified.

admin
Site Admin
Posts: 66305
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Column property to show number of sub-images in ICO file

Post 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... :whistle:

(Is this a deja-vu? It seems to me we did this before somewhere/when...)

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Column property to show number of sub-images in ICO file

Post by TheQwerty »

Why not add ICO support to Get('CountIcons')?

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

Re: Column property to show number of sub-images in ICO file

Post 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!
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Column property to show number of sub-images in ICO file

Post 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.

admin
Site Admin
Posts: 66305
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Column property to show number of sub-images in ICO file

Post by admin »

TheQwerty wrote:Why not add ICO support to Get('CountIcons')?
Yeah! :tup:

PS: Next beta:
IconCount.png
To see the attached files, you need to log into the forum.

admin
Site Admin
Posts: 66305
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Column property to show number of sub-images in ICO file

Post 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

kunkel321
Posts: 664
Joined: 10 Jun 2012 03:45
Location: Near Seattle

Re: Column property to show number of sub-images in ICO file

Post 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)?
ste(phen|ve) kunkel
Scaling: Main monitor 125%, Secondary monitor on the right 100%
OS: Win 10. XYplorer version: Latest beta, unless specified.

admin
Site Admin
Posts: 66305
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Column property to show number of sub-images in ICO file

Post 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.

kunkel321
Posts: 664
Joined: 10 Jun 2012 03:45
Location: Near Seattle

Re: Column property to show number of sub-images in ICO file

Post by kunkel321 »

It works like a charm! Thanks for adding this Don! :biggrin:

Of course now I have to decide if my default columns should show ICO dimensions, or image counts. :cry: (first world problem, lol)
ste(phen|ve) kunkel
Scaling: Main monitor 125%, Secondary monitor on the right 100%
OS: Win 10. XYplorer version: Latest beta, unless specified.

Post Reply