|
Page 1 of 1 |
|
Posted: Sun, 6th Oct 2019 16:14 Post subject: Windows - custom icons for arbitrary files possible? |
|
 |
Hello,
you know how you can include a DVD-cover instead of the regular thumbnail-preview for video files or the Album-cover for any music files - in the explorer?
Is this possible for any arbitrary file types as well? Like ZIP or XLS or so?
Like, could I pick one ZIP file out of 20 and pick a custom icon for that one ZIP file alone (not all ZIP files in general, as I know how to do that, plus that would be too easy).
Same with any other file type, obviously hence the generalized question.
I don't think it's possible, but I thought I'd ask to make sure.
Also... search google for "custom icon xyz" and you just get suggestions for particular icons of the entire type of files... yeah, no thanks google. 
"There will be no end to the troubles of humanity, until philosophers become kings, or kings become philosophers.", Plato.
"Hyperbole will destroy us all.", Matt Dillahunty.
"The hyperbole, the demonization of the other opinion and the unwillingness to even read the opposing opinion destroys the so important political discussions necessary for the well functioning of society.", Couleur
|
|
Back to top |
|
 |
3E74
Posts: 2559
Location: feels wrong
|
Posted: Sun, 6th Oct 2019 19:44 Post subject: |
|
 |
Ok, i found this interessting to Test out... since i cant stand the Standart windows design, i tried out some Tools and learned some things along the way.. And i do have a tool for some years in use that does exactly this...
And would you look at that....
Ok, so it does work... BUT, im using Windows 7.. So i do not know if this even works for you...
Now, what im using is an "Cleaned" version of IconPackager.. I think its an Stardock Product... I do not know if it works for windows 10, or if theres an updated "Clean" version for Win 10 for it..
I do not think theres another way to do this, only if theres another tool like this..
Anyway, this is how it looks in Action...
im gonna see if i find something suitable for windows 10...
Did that help?
edit:
Iconpackager does not run in the background, wich is why i used it.. So, it might be possible to find out how IconPackager does that, and see if we can do this without IconPackager.. just a thought...
Edit2:
ok, i looked at Stardocks site and they do support win10...
Quote: |
Key Features
Replace default Windows icons with icon packages
Change individual file type icons
Recolor icon packages
Windows 7, 8, 10 support |
--> https://www.stardock.com/products/iconpackager/
Version Version: 10.02 is the newest one and works without problems with win10..
Sadly, theres only a "Clean" V.5.10 version floating in the seas.. Wich does not really work with windows 10 (latest)..
......
*keeps looking....
If you are a programmer you could write an icon handler.
--> https://docs.microsoft.com/en-us/windows/win32/shell/how-to-create-icon-handlers?redirectedfrom=MSDN
Spoiler: | Quote: |
Instructions
Step 1: Implementing Icon Handlers
Like all Shell extension handlers, icon handlers are in-process Component Object Model (COM) objects implemented as DLLs. They must export two interfaces in addition to IUnknown: IPersistFile and IExtractIcon.
The Shell initializes the handler through its IPersistFile interface. It uses this interface to request the handler's class identifier (CLSID) and provides it with the file's name. The rest of the operation takes place through the IExtractIcon interface. For a general discussion of how to implement Shell extension handlers, including the IPersistFile interface, see Creating Shell Extension Handlers. The remainder of this document discusses how to implement the IExtractIcon interface.
Step 2: Implementing the IExtractIcon Interface
After the interface is initialized, the Shell uses the handler's IExtractIcon interface to request the appropriate icon. The interface has two methods: IExtractIcon::GetIconLocation and IExtractIcon::Extract.
Icons are identified by their location in the file system. The IExtractIcon::GetIconLocation method is called to request this information. Set the szIconFile parameter to the file name. If there is more than one icon in the file, set piIndex to the icon's index. Assign appropriate values to the two flag variables. If you do not want to specify a file name, or if you do not want the Shell to extract the icon, set the GIL_NOTFILENAME flag in the pwFlags parameter. You do not need to assign a value to szIconFile, but the handler must provide icon handles when the Shell calls IExtractIcon::Extract.
If you return a file name, the Shell normally attempts to load the icon from its cache. To prevent the loading of a cached icon, set the GIL_DONTCACHE flag in the pwFlags parameter. If a cached icon is not loaded, the Shell then calls IExtractIcon::Extract to request the icon handle.
If a file and index were specified by IExtractIcon::GetIconLocation, they are passed to IExtractIcon::Extract in the pszFile and nIconIndex parameters, respectively. If a file name is provided, your handler can return S_FALSE to have the Shell extract the icon. Otherwise, your handler must extract or otherwise produce large and small icons, and assign their HICON handles to the phiconLarge and phiconSmall parameters. The Shell adds the icons to its cache to expedite subsequent calls to the handler.
Step 3: Registering Icon Handlers
When you statically register an icon for a file type, you create a DefaultIcon subkey under the ProgID for the file type. Its default value is set to the file that contains the icon. To register an icon handler, you must still have the DefaultIcon subkey, but its default value must be set to "%1". Add an IconHandler subkey to the Shellex subkey of the ProgID subkey, and set its default value to the string form of the handler's CLSID GUID. For a general discussion of how to register Shell extension handlers, see Creating Shell Extension Handlers.
The following example modifies the registry entry from Customizing Icons so that the .myp file type now uses a shortcut menu handler instead of a statically defined icon.
Code: |
HKEY_CLASSES_ROOT
.myp
(Default) = MyProgram.1
MyProgram.1
(Default) = MyProgram Application
DefaultIcon
(Default) = %1
Shellex
IconHandler
(Default) = {The handler's CLSID GUID} |
|
|
..:: Life - A sexually transmitted disease which always ends in death. There is currently no known cure::.. 
|
|
Back to top |
|
 |
3E74
Posts: 2559
Location: feels wrong
|
Posted: Thu, 10th Oct 2019 19:40 Post subject: |
|
 |
aand, did you find something?
..:: Life - A sexually transmitted disease which always ends in death. There is currently no known cure::.. 
|
|
Back to top |
|
 |
Page 1 of 1 |
All times are GMT + 1 Hour |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB 2.0.8 © 2001, 2002 phpBB Group
|
|
 |
|