Replacing Folder Icons on a Per-Folder Basis

B

Bethany

I've been able to change the default icons for other kinds of files in the
shell, but I have been totally unable to change the folder icons.

Setting DefaultIcon in the registry doesn't appear to work.

Desktop.ini wouldn't really work for me (since I want to affect _all_
folder icons the user looks at, and don't want hundreds of desktop.ini
files), but I don't seem to be able to get it to work anyway (I used the
MSDN sample).

I'm currently running on XP SP2.


Any tips?

-B
 
B

Bethany

Bethany,

To change the Folder icons (all), read this note from David:
http://groups.google.co.in/groups?selm=#l9AuBUJEHA.1220@TK2MSFTNGP1
1.phx.gbl

To set the icon on per-folder basis, Desktop.ini is ideal. See:
"Customizing Folders with Desktop.ini:"

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellc
c/platform/shell/programmersguide/shell_basics/shell_basics_extending/c
ustom.asp

Thanks for answering Ramesh,

I read both articles.

I am trying to write a shell extension to put a logo on folders our
software is managing (like the sharing hand, or shortcut arrow already
present in Windows).

From the articles it sounds like:
+ I'd have to add a desktop.ini file to every folder in the user's system
+ I'd have to set the 'system' attribute on every folder in the user's
system
+ I'd need a hook into the shell so I could add a desktop.ini whenever
the user created/opened a new folder.


How does MicroSoft put a hand under folders when they are shared?


-B
 
B

Bethany

Bethany,

Apart from using Desktop.ini, I guess this is possible by writing an
IconHandler. Perhaps the SDK experts will help in that regard.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellc
c/platform/shell/programmersguide/shell_int/shell_int_extending/extensi
onhandlers/iconhandlers.asp

For Example this software, uses IconHandler and is able to change the
displayed icon on per-file basis.

"Icon Changer" - http://www.shelllabs.com

I tried "Icon Changer". They use desktop.ini files, but that's more to
reflect single time customization rather than status info.

Unfortunately icon handlers don't work on folders. Windows treats them
differently somehow. I have IconHandler code that works fine on file
icons, but is never called on folders.

I was able to get part of what I wanted by using IconOverlay Handlers, but
they compete with other system overlays, have to be defined at shell
startup, and only a few overlay images can exist in the system.

I'll wait to see if any SDK experts can help.

Thanks for your help,


-B
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top