You can use the xps-IThumbnailProvider for zip-files, no need to write your own one !!!
Add the Thumbnail to your zip-file:
Files must not have a BOM !!!
Try until your file displays the thumbnail if you rename it to .xps
Public WriteOnly Property Thumbnail As Image
Set(value As Image)
If value IsNot Nothing Then
Dim relsdir = Me.ZipArchivWriter.CreateEntry("_rels/", CompressionLevel.NoCompression)
Using rels = Me.ZipArchivWriter.CreateEntry("_rels/.rels", CompressionLevel.Fastest).Open
Using w As New StreamWriter(rels, FXENCODING)
w.WriteLine(XMLSTART)
w.WriteLine("<Relationships xmlns=""http://schemas.openxmlformats.org/package/2006/relationships"">")
w.WriteLine("<Relationship Target=""thumbnail.png"" Id=""R1"" Type=""http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail"" />")
w.WriteLine("</Relationships>")
End Using
End Using
Using ct = Me.ZipArchivWriter.CreateEntry("[Content_Types].xml", CompressionLevel.Fastest).Open
Using w As New StreamWriter(ct, FXENCODING)
w.WriteLine(XMLSTART)
w.WriteLine("<Types xmlns=""http://schemas.openxmlformats.org/package/2006/content-types"">")
w.WriteLine("<Default Extension=""rels"" ContentType=""application/vnd.openxmlformats-package.relationships+xml"" />")
w.WriteLine("<Default Extension=""PNG"" ContentType=""image/png"" />")
w.WriteLine("</Types>")
End Using
End Using
Using tn = Me.ZipArchivWriter.CreateEntry(FXTHUMBNAIL, CompressionLevel.NoCompression).Open
value.Save(tn, ImageFormat.Png)
End Using
End If
End Set
End Property
And then add your file-extension to the registry (ClassesRoot or CurrentUser):
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\.frax\shellex\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}]
@="{44121072-A222-48f2-A58A-6D9AD51EBBE9}"
[HKEY_CURRENT_USER\Software\Classes\.frax\shellex\{e357fccd-a995-4576-b01f-234630154e96}]
@="{44121072-A222-48f2-A58A-6D9AD51EBBE9}"
[HKEY_CURRENT_USER\Software\Classes\.frax\shellex\PropertyHandler]
@="{45670FA8-ED97-4F44-BC93-305082590BFB}"
That's all...