More about the icon cache.
Here's a copy of the results of an experiment that MVP Mark Dormer and myself ran a few years ago. It's been posted to ME and 98 groups but not XP before - while details (like filename) differ the process is the same. Search for sysilvue program that allows you to look at the memory cache (email me if you can't find it - and if another 300 viruses aren't in my inbox when you send the mail I may even see it - I spent the weekend telneting to my mail server deleting messages one by one from the server - they arrived in batches of 30 to 50 at a time.)..
Shelliconcache
File: %Windir%/ShellIconCache
Registry:
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\explorer]
"Max Cached Icons"="Decimal Value"
The ShellIconCache is memory resident and appears to be an imagelist
(Windows Common Control).
It gets written to disk when the Shutdown Dialog is called, as long as the
number of entries in the memory copy is less than the number specified in
the registry key
The maximum number of images that I can cache is 4090.
This varies slightly and may be due to .bmp's that I am displaying as Icons
(needs more research). However all tests ended up with between 3900 and
4090. It also seems to coincide with the filesize being around 10.6Mb.
However the maximum number of entries in the cache is dependent on the
registry key value.
If I set it to 15000, then the first ~4090 entries get the images cached and
the remainder only have there names cached.
Once ~4090 images are cached then any uncached icon will not be displayed.
The confusion over 2000 and 2048 appears to come from the KB getting
updated.
The KB article Q132668 13/03/99 says to try 2048, it does not specify
limits.
The KB article Q132668 02/12/99 specifies 100-2000 as the limits.
In order to delete the memory copy change Icon size. TweakUI uses this
method, it chages size by 1 and then puts it back to original setting.
The disk file can be deleted at any time.
So to fix all you need to do is
1. Change Icon size momentarily
2. Delete the ShellIconCache file
Step 3. is only needed if you want to write the file before restarting in
order to view it.
3. Call Shutdown and cancel, to write a new copy from memory
Load Order
This appears consistent on my machine
1. Shell32.dll First 45 Icons
2. QuickLaunch Toolbar Icons
3. Desktop Icons
4. StartMenu Icons
5. As you use them
Damn, I know I have forgotten something.
Regards
Mark Dormer
Icons Randomly Change to Different Icons
http://support.microsoft.com/support/kb/articles/Q132/6/68.asp
I've updated the info after the result of further tests
Shelliconcache
File: %Windir%/ShellIconCache
Registry:
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\explorer]
"Max Cached Icons"="Decimal Value"
Results of tests with different size icons and display sizes.
Icon Size Display Size Cache Size
16x16x1 16 8182
48x48x16 16 8182
16x16x1 24 5443
16x16x1 32 4090
16x16x8 32 4090
48x48x16 32 4090
16x16x1 48 2704
16x16x8 48 2704
48x48x16 48 2704
The only factor involved in the cache size is the Display size
When full the physical size is between 9-11 Mb depending on the icon size.
The ShellIconCache is memory resident and appears to be an imagelist
(Windows Common Control). I say this because I am accessing it the same way
as I would an image list.
It gets written to disk when the Shutdown Dialog is called, as long as the
number of entries in the memory copy is less than the number specified in
the registry key
The maximum number of images that can be cached is dependent on the
displayed icon size.
However the maximum number of entries in the cache is dependent on the
registry key value.
If I set it to 15000, then the first *(see note 1)4090 entries get the
images cached and the remainder only have there names cached.
Once *(see note 1) 4090 images are cached then any uncached icon will not be
displayed.
*(note 1) using display size 32
The confusion over 2000 and 2048 appears to come from the KB getting
updated.
The KB article Q132668 13/03/99 says to try 2048, it does not specify
limits.
The KB article Q132668 02/12/99 specifies 100-2000 as the limits.
In order to delete the memory copy change Icon size. TweakUI uses this
method, it chages size by 1 and then puts it back to original setting.
The disk file can be deleted at any time.
So to fix all you need to do is
1. Change Icon size momentarily
2. Delete the ShellIconCache file
Step 3. is only needed if you want to write the file before restarting in
order to view it.
3. Call Shutdown and cancel, to write a new copy from memory
Load Order
This appears consistent on my machine
1. Shell32.dll First 45 Icons
2. QuickLaunch Toolbar Icons
3. Desktop Icons
4. StartMenu Icons
5. As you use them
Mark Dormer
(e-mail address removed)
Regards
Mark Dormer
_____________________
----- Original Message -----
From: "Alex Nichol" <
[email protected]>
To: <
[email protected]>
Sent: Monday, June 19, 2000 8:59 PM
Subject: Re: Icons
Damn, I know I have forgotten something.
What size icons do you use? To indicate whether the file/memory area
size size or number is the actual limiting matter?
Interesting: neither 4090 nor 10.6 MB seems particularly probable as
an actual limit (though 4096 might be) Sounds as if 4000 might be a
sensible round number
--
Alex Nichol
Bournemouth, U.K. (e-mail address removed)
I tried a couple of tests with display colour depth
All my previous tests had been done with a 16 bit display depth.
I changed to 8 bit and it made no difference.
Also, which is a giveaway, changing colour depth doesn't flush the cache.
So I'll conclude that it is only the icon depth that matters, not the
display depth
Regards
Mark Dormer
--
David Candy
http://www.mvps.org/serenitymacros/
http://www.simtel.com/pub/pd/18669.html
Ramesh said:
Excellent!
Earlier, I changed the value for this key and that dint work:
HKEY_CLASSES_ROOT\Folder\DefaultIcon
[when I open a common dialog open/saveas window, the icon I chose appears
for a second and resets to normal folder view.]
Will try what you said. Thx again!!!
--
Regards,
Ramesh
AOL: SRamesh2k
«·´`·.(*·.¸(`·.¸ ¸.·´)¸.·*).·´`·»
«.............. Ramesh ...............»
«·´`·.(¸.·´(¸.·* *·.¸)`·.¸).·´`·»
~ Please reply to newsgroup ~
Yes ShellFolders key.
Shell Icons
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\Shell
Icons]
"Number from list below"="Path to icon, Icon index"
The list below specifies the number for the default shell icons.
The path to icon is a dos path to the icon, in a registry file remembe to
use \\ (regedit rmoves one \ when merging).
The icon index is used when the icons are coming from a binary file like a
.dll or .exe. It is the position of the icon in the file (a negitive number
is the inverse of the resource ID). Omit the comma and Icon Index when using
an .ICO file.
To get the index create a shortcut, right click and choose Properties, then
Change Icon, then Browse. Select the file and click open. The icons are
numbered from 0 downwards then across.
Icons can also be set under the Default Icon setting for the object in
HKEY_ROOT (which is where Windows stores its' icon information), the Shell
Icon setting overrides this.
Value Description
0 Unknown File Type
1 Default Document
2 Default Application
3 Folder
4 Open Folder
5 5.25 inch Floppy
6 3.5 inch Floppy
7 Removable Drive
8 Hard Drive
9 Network Drive
10 Network Disconnected
11 Cd-rom Drive
12 Ram Drive
13 Globe
14 Network Pipes ?
15 Desktop
16 Print Manager
17 Network Neighborhood
18 Workgroup
19 Program
20 Document Folder
21 Settings
22 Find
23 Hint
24 Command
25 Screen Saver
26 Docking
27 Display
28 Sharing Overlay (Hand)
29 Shortcut Overlay (Small Arrow)
30 Default Printer Overlay (Small Tick)
31 Recycled Empty
32 Recycled Full
33 Dial-up Networking
34 Desktop
35 Control Panel
36 Program Groups
37 Printers
38 Font
39 Start Menu settings
40 Audio Cd
44 Log Off
45 May not apply to Win98
46 May not apply to Win98
Download a zip file called OpenFolder.zip containing a green open icon and
registry file that makes the current open folder in Explorer green. In later
versions of the shell the icon index must be specified (which is 0) and an
extra reg file has been added (15/9/00).
Note 3 and 4. See the icons page on my website. This is the same order as
the icons you see in the Change Icon dialog (shell32).
Note you must rebuild the icon cache to see the changes, these are the 4th
and 5th icons loaded into the cache so they are always in cache. All of
these are loaded into the cache as soon as it's built, as well as icons on
the Desktop and Start Menu. The cache is saved on shutdown and reloaded on
Startup so can take months to refesh itself.
To refresh the icons in the system change the size of icons in Start -
Control Panel - Display - Appearance - Advanced, click apply then change the
size back. This is what tweakui does to repair icons.
--
David Candy
http://www.mvps.org/serenitymacros/
http://www.simtel.com/pub/pd/18669.html
Ramesh said:
Hi David,
General question:
Is it possible to change the folder icons programatically (all folders in
the drive). Apart from editing the desktop.ini file.
thanks.
--
Regards,
Ramesh
AOL: SRamesh2k
«·´`·.(*·.¸(`·.¸ ¸.·´)¸.·*).·´`·»
«.............. Ramesh ...............»
«·´`·.(¸.·´(¸.·* *·.¸)`·.¸).·´`·»
~ Please reply to newsgroup ~
So why not read the documentation that told you to edit the file. The docs
are quite specific.