Windows Explorer - custom icon for each file?

I'm just curious, as this is probably too big a problem to be worth it for me. I am wondering how it is possible for each user-type file to have a different descriptive icon in Windows Explorer. A classic example is Photoshop.psd files. Windows doesn't know what psd is (I guess?), But somehow, when viewed on Windows, the file icon is a thumbnail of the psd itself.

How it's done? I am curious both from the point of view of programming, and from the point of view of OS. For example, when Windows sees .psd, what does it do to get a sketch? Does Adobe install any single utility in the magical location that Windows uses to create thumbnails for the file?

+3
source share
2 answers

This is done using shell extension handlers to see how this is done, see Creating icon handlers .

+6
source

This is done using the so-called shell extension. In the case of .psd files, Photoshop probably installs a small DLL that the shell loads to display thumbnails on demand. The shell extension knows how to read the .psd file to get a sketch that can even be saved in the file when it was saved as an optimization.

+1
source

Source: https://habr.com/ru/post/1783034/


All Articles