Windows explorer icons

J

Jon Slaughter

I'm trying to create a windows explorer like app and the problem I'm having
is getting the proper icon for the folders and items.

In windows explorer there are many different icons and most seem to be in
the shell32.dll. The problem is that there also seems to be custom icons
that are installed by applications.

For example, "My Music" In My Documents has an icon that is different from
the normal folders. I have installed an application that has put its own
icon.

As far as I can tell windows seems to take the icon from the desktop.ini
because when I deleted it for the application I also removed the displayed
icon and it reverted back to the default.

So, if this is the case then its not to hard to get the default icon as I
just have to parse the desktop.ini... but which icon is used(I suppose its
not to hard to find out if I just load the resources in the dll but I'd like
a definite answer).

Also, What about the default icons? I can manually try and match what goes
where by getting the file type and extension but this seems a little like
hacking. Surely windows explorer doesn't do this? Or if it does then is
there any documentation of exactly which icons do what. Ofcourse I don't
have to follow its scheme exactly for directories as there are only a few
cases(My computer, My network places, recycle bin, etc..) but I need to know
how to extract the icon for the associated file type. (i.e., an .h has that
icon with an h in it, etc...).

The thing is, is that for some "directories" in windows explorer such as "My
shared folders" there are custom icons(or what looks to be) but no
corresponding ini. I'm not sure if windows explorer is hard coding the icons
for this or what? (ofcourse this is a special folder so I suppose it
probably does).

I'd just like to be able to get a similar structure for consistancy and not
have anything hard coded(incase there is a change in the system then my
application will reflect that change(i.e., someone changing the icons used)
except for files which, ofcourse, I need to be consistant because its
impossible to deal with all the possibilities. I don't mind hard coding
custom icons for the file directories though as there seems to be only a few
cases.

It would be nice if there was an associated icon in
System.Enviroment.SpecialFolder.xxx (instead of just the path). I suppose I
could look for desktop.ini in the dir and then load the icon if thats what
windows explorer does(but I think it hard codes them for "Special folders").


Any ideas?

Thanks
Jon
 
J

Jon Slaughter

For example, "My Music" In My Documents has an icon that is different from
the normal folders. I have installed an application that has put its own
icon.

As far as I can tell windows seems to take the icon from the desktop.ini
because when I deleted it for the application I also removed the displayed
icon and it reverted back to the default.

duh... didn't see the "IconIndex" ;/ must be going blind ;/
 

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