Tesserex
Tesserex

Reputation: 17314

windows explorer - custom icon for each file?

I'm just curious about this, as it's probably too much trouble to be worth it for me. I'm wondering how it's possible to have each file of a custom type have a different, descriptive icon in windows explorer. A classic example it Photoshop's .psd files. Windows doesn't natively have a clue what a psd is (I assume?), but somehow, when browsing in Windows, the file icon is a thumbnail of the psd itself.

How is this done? I'm curious both from a programming perspective and OS perspective. For example, when Windows sees .psd, what does it do to get the thumbnail? Does Adobe install some separate utility in a magic location that Windows uses to generate the thumbnail for the file?

Upvotes: 4

Views: 1492

Answers (2)

David Heffernan
David Heffernan

Reputation: 612934

It's done with something called a shell extension. In the case of the .psd files Photoshop probably installs a small DLL which is loaded by the shell to display the thumbnails on demand. The shell extension knows how to read the .psd file to get a thumbnail which may even have been stored in the file when it was saved as an optimisation.

Upvotes: 1

ismail
ismail

Reputation: 47592

This is done via Shell Extension Handlers , to see how its done , see Creating Icon Handlers .

Upvotes: 7

Related Questions