Attribute VB_Name = "Module1"
Public m_oStorage As IStorage

Enum FileInfo
   Filename
   FileType
   PackedSize
   HasAPassword
   Method
   Size
   Ratio
   Date
   CRC32
End Enum

Public Sub ShowAddPassword(fname)
Dim oCtxMenu As IContextMenu
Dim tICI As CMINVOKECOMMANDINFO
Dim oPF As IPersistFile

   Set m_oStorage = CreateObject("compressedfolder")
   Set oPF = m_oStorage
   oPF.Load fname, STGM_READWRITE Or STGM_SHARE_EXCLUSIVE

   Set oCtxMenu = getContextMenu
   
   tICI.cbSize = Len(tICI)
   tICI.lpVerb = 1
   Form1.Timer1.Interval = 300
   Form1.Timer1.Enabled = True
   oCtxMenu.InvokeCommand tICI
   
End Sub


Private Function getContextMenu() As IContextMenu
Dim oSF As IShellFolder
Dim tIID_IContextMenu As UUID
Dim lPtr As Long

   ' Initialize IDs
   CLSIDFromString IIDSTR_IContextMenu, tIID_IContextMenu
   
   ' Get the folder object
   Set oSF = m_oStorage
   
   ' Get the context menu
   lPtr = oSF.CreateViewObject(0, tIID_IContextMenu)
   MoveMemory getContextMenu, lPtr, 4&

End Function

