Question How to set little icon over file icon in Windows Explorer?

RedScarf

Member
Joined
Apr 6, 2016
Messages
5
Programming Experience
Beginner
Hi,
I have following problem. I have a file processing engine which is started by context menu of a file or directory. Now I want to mark processed files and directories with a little icon (green check).
How can I independently of the file type realize this? Can not find anything in the web :\

Thx in advance
RedScarf
 
Hah! I got in seconds before you with the same two links. I'm #1! I'm #1! In your face Flanders! ;)
I noticed, and thought about deleting my post, but then again both my links were pretty with correct document titles. :smokin: :pirate:
 
Hi,
thank you and "icon overlay" was indeed not my search term.

I tried the SharpShell tutorial but didn't succeeded. My class is present in registry but i can not see the icon overlay :\
VB.NET:
Option Strict On
Option Explicit On
Imports System.Runtime.InteropServices
Imports SharpShell.Interop
<ComVisible(True)>
Public Class IconOverlayYeah : Inherits SharpShell.SharpIconOverlayHandler.SharpIconOverlayHandler


    Protected Overrides Function CanShowOverlay(path As String, attributes As FILE_ATTRIBUTE) As Boolean
        Return True
    End Function


    Protected Overrides Function GetOverlayIcon() As System.Drawing.Icon
        Return New System.Drawing.Icon("C:\Users\windwos\Desktop\Away.ico")
    End Function


    Protected Overrides Function GetPriority() As Integer
        Return 90
    End Function
End Class
Thought that now all files should have my Away.ico as overlay.
 
Ok. I have also been unable to make it work, there are some troubleshooting tips here that you could try: SharpShell - Documentation
 
Argh, I tried anything listed (workaround for other SharpShell-Tools, too) but I am still unable to get it working.
Is there another way to solve this?
 
Using an ico-image from resources solved my problem: thx!
I tried that too, but it didn't display for me. Debugging in various ways showed my overlay icon dll should work (for example the SharpShell library creates a temporary file when the icon is called, and mine did - and SharpShell Server Manager shell indicated it applied correctly), but it never displayed, also tried different icons including the one form CP sample code. I also went through also those troubleshooting tips. Just to be clear, by "resources" do you mean My.Resources like the CodeProject example, or as separate embedded resource in assembly? I tested only with icon in My.Resources. A bit annoying since I use Google Drive and know their overlay icons works fine on my system. The limitations of API itself is also annoying, seems like an old system due for modernization. Not important for me though, just wanted to try and see if I could do it.
 
Back
Top