0
votes

I want to add a File Explorer Context Menu DLL Handler using Denis Anisimov answer in his Copying file details from Explorer as tabular text posting from 4 years ago. Specifically, from Denis’ zip file download, I want copy his 64-bit DLL somewhere and hook up my registry to it. Regrettably, Denis’ single Registry reference is to HKCR\AllFilesystemObjects which has stumped me.

Is HKCR\AllFilesystemObjects still true for Windows 10? I see entries for the * wildcard and for specific file extensions.

If so, to simplify usage, I’d like to restrict my Context menu item to Image files only, to “Copy Image Details”.

Does that mean I have to add to all image file extensions, to .jpg, .png, .gif and so on? Sure, choosing shell or shellex, adding keys, entering menu text and connecting to the DLL should be easy.

But I cannot find a complete answer. I find numerous incomplete some-but-not-all examples with significantly different keys. I do not want to hack them together.

2
It is certainly still there on my Win10 machine. msdn.microsoft.com/en-us/library/windows/desktop/… But since a directory is never an image file you'll of course favor * instead.Hans Passant

2 Answers

0
votes

Probably not helpful, maybe you resolved this already. I noticed you have 2x options for System Context Menus, you can add items via the registry or via the DLL library, I was searching for more info when I found your post, as I was trying to find out the pros/cons for using either method.

It seems like a mess to me, probably relating to older versions of windows.

0
votes

After some rummaging, I found these old, but plentiful resource-searches.

• Google “code project idiot's guide writing shell extension handlers”

• Youtube “shell extension handler”

Still, I gave up and, instead, wrote the following simple vb.net utility. Yes, you’ll have tailor this to your folders and files, but nonetheless you are able to drill down to numeric file attributes easily.

Imports System.IO
Imports System.Collections.Generic
Imports System.Collections.ObjectModel
Imports System.Drawing

Module ShapesModule

    Sub Main()
        Dim SearchKind As SearchOption = SearchOption.TopDirectoryOnly

        Dim DRGW_StationFolders As ReadOnlyCollection(Of String) = My.Computer.FileSystem.GetDirectories("C:\Users\Dave Owens\!! D&RGW NarrowGauge IMAGES Maps !!")
        Dim LogFile As System.IO.StreamWriter = My.Computer.FileSystem.OpenTextFileWriter("C:\Users\Dave Owens\DRGW PixDimensions\Logs\Jpegs Analysis.log", True)
        For Each folder As String In DRGW_StationFolders
            If folder.Contains("mp") Then
                Dim ImageFiles As ReadOnlyCollection(Of String) = My.Computer.FileSystem.GetFiles(folder, FileIO.SearchOption.SearchTopLevelOnly, "*.jpg")
                If ImageFiles.Count > 0 Then
                    For Each JpegFile As String In ImageFiles
                        Dim bmp As New Bitmap(JpegFile.ToString())
                        Dim AspectRatio As Double = bmp.Width / bmp.Height
                        Dim ImageInfo As New FileInfo(JpegFile.ToString())
                        LogFile.WriteLine("{0,-24} |     W={1,-12}  |  H={2,-10}  |   AspRat={3, -10})", ImageInfo.Name, bmp.Width, bmp.Height, Math.Round(AspectRatio, 4))
                    Next
                End If
            End If
        Next
        LogFile.Close()
    End Sub

End Module