Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 749
Tesserex Avatar asked Oct 20 '25 10:10

Tesserex


2 Answers

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

like image 185
ismail Avatar answered Oct 22 '25 03:10

ismail


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.

like image 40
David Heffernan Avatar answered Oct 22 '25 03:10

David Heffernan