home *** CD-ROM | disk | FTP | other *** search
/ Chip Hitware 3 / Chip_Hitware_Vol_03.iso / chiphit3 / win95 / tool / zipserv / zipserv.rv_ / zipserv.rv
Text File  |  1995-09-12  |  8KB  |  121 lines

  1. '  Visual Basic declarations section for dynamic-link library : ZIPSERV.DLL
  2. '  Description: ZipServ
  3.  
  4. '  Visual Basic declarations :
  5.  
  6. Declare Function Zip Lib "ZIPSERV.DLL" (ByVal ZipName As String, ByVal FileToZip As String, ByVal Keep As Integer, ByVal Store As Integer, ByVal Recur As Integer, ByVal Pword As String, ByVal WPath As String, ByVal ZPath As String) As Integer
  7.     'ZipName      - the name of the ZipFile, like "C:\MY\CONRAD.ZIP", with the complete path
  8.     'FileToZip    - the name of the file to zip including the path, wild characters allowed
  9.     'Keep         - True (non zero) when the originak date at update to be kept in the Zip file
  10.     'Store        - True (non zero) when the path is to be stored in the Zip file
  11.     'Recur        - True (non zero) when recursive subdirectories in the Zip file
  12.     'Pword        - Password (if any)
  13.     'WPath        - A Path for the ZipServer that can be used as working area (read\Write access)
  14.     'ZPath        - Normally the Windows\System directory, or the directory where the "ZIPSERV.LIC" file was installed
  15.     '               if a Null string is passed the Windows\System directory will be taken
  16.     'ReturnValue  - Zero (0) for success, or call ZipError(ReturnValue) for more details
  17. Declare Function Unzip Lib "ZIPSERV.DLL" (ByVal ZipFileName As String, ByVal Dest As String, ByVal F2Unzip As String, ByVal Rest As Integer, ByVal OW As Integer, ByVal Pword As String, ByVal WPath As String, ByVal ZPath As String) As Integer
  18.     'Identical names have the same meaning as for Zip
  19.     'Dest         - The Destination directory where the file(s) to be unzipped
  20.     'F2Unzip      - The name of the file including path that to be unzipped. Wild characters are allowed.
  21.     'Rest         - True (non zero) when the stored path in the Zip file is to be restored
  22.     'OW           - True (non zero) when existing files are to be overwritten
  23. Declare Function ZipError Lib "ZIPSERV.DLL" (ByVal ErrCode As Integer) As String
  24. Declare Function DriveType Lib "ZIPSERV.DLL" (ByVal DriveLetter As String) As Integer
  25.     '0            - drive not found
  26.     '2            - floppy disk drive
  27.     '3            - hard disk drive
  28.     '4            - remote drive (network drive)
  29. Declare Function DropCombo Lib "ZIPSERV.DLL" (ByVal hWnd As Integer) As Integer
  30. Declare Function FromIni Lib "ZIPSERV.DLL" (ByVal Ininame As String, ByVal Section As String, ByVal Request As String) As String
  31.     'Ininame      - name including the full path for the INI file
  32.     'Section      - name of the section in the INI file (section name is in [ ] brackets)
  33.     'Request      - the name of the parameter (left side value)
  34. Declare Function FromWinIni Lib "ZIPSERV.DLL" (ByVal Appname As String, ByVal Request As String, ByVal Default As String) As String
  35.     'Appname      - the name of the section in WIN.INI
  36.     'Default      - the default value of Request which will be written and returned if there is no other value avaiable
  37. Declare Function WinPath Lib "ZIPSERV.DLL" () As String
  38. Declare Function WinSysPath Lib "ZIPSERV.DLL" () As String
  39. Declare Function WriteWinIni Lib "ZIPSERV.DLL" (ByVal Appname As String, ByVal Request As String, ByVal Value As String) As Integer
  40.     'ReturnValue = 0 if success
  41. Declare Function WriteIni Lib "ZIPSERV.DLL" (ByVal Ininame As String, ByVal Section As String, ByVal Request As String, ByVal Value As String) As Integer
  42.     'ReturnValue = 0 if success
  43. Declare Function RemoveIniLine Lib "ZIPSERV.DLL" (ByVal Ininame As String, ByVal Section As String, ByVal Request As String) As Integer
  44.     'ReturnValue = 0 if success
  45. Declare Function RemoveIniSection Lib "ZIPSERV.DLL" (ByVal Ininame As String, ByVal Section As String) As Integer
  46.     'ReturnValue = 0 if success
  47. Declare Sub ReadOnlyTextBox Lib "ZIPSERV.DLL" (ByVal hWnd As Integer)
  48.     'hWnd         - the textbox's hWnd property value
  49. Declare Sub StayOnTop Lib "ZIPSERV.DLL" (ByVal hWnd As Integer, ByVal status As Integer)
  50.     'hWnd property of the form
  51.     'status = 0   - do not stay on top
  52.     'status <>0   - stay on top
  53. Declare Sub DisplayTextFile Lib "ZIPSERV.DLL" (ByVal Textfile As String, ByVal Title As String, ByVal hWndParent As Integer, ByVal ReadOnly As Integer)
  54.     'Textfile     - the name including the full path of the textfile to be displayed
  55.     'Title        - the title of the display
  56.     'hWndParent   - the hWnd property value of the form from the calling application
  57.     'ReadOnly     - True (non zero) value results in read only display
  58. Declare Function ExtractBase Lib "ZIPSERV.DLL" (ByVal File As String) As String
  59.     'File         - the name including the full path of a file
  60. Declare Function ExtractPath Lib "ZIPSERV.DLL" (ByVal File As String) As String
  61. Declare Function ExtractFile Lib "ZIPSERV.DLL" (ByVal File As String) As String
  62. Declare Sub AddZipComment Lib "ZIPSERV.DLL" (ByVal ZipFile As String, ByVal Comment As String)
  63. Declare Function GetZipComment Lib "ZIPSERV.DLL" (ByVal ZipFile As String) As String
  64. Declare Sub DisplayProcess Lib "ZIPSERV.DLL" (ByVal status As Integer)
  65. Declare Sub DisplayProcessLTW Lib "ZIPSERV.DLL" (ByVal status As Integer, ByVal dLeft As Integer, ByVal dTop As Integer, ByVal dWidth As Integer)
  66. Declare Function MultiZipCount Lib "ZIPSERV.DLL" (ByVal ZipFile As String) As Long
  67. Declare Function MultiZipped Lib "ZIPSERV.DLL" (ByVal ListIndex As Long) As String
  68. Declare Function MultiZip Lib "ZIPSERV.DLL" (ByVal ZipFile As String, ByVal FilesToZip As String, ByVal Recurse As Integer, ByVal StorePath As Integer, ByVal FirstSize As Long, ByVal LaterSize As Long, ByVal WPath As String, ByVal ZPath As String) As Integer
  69. Declare Function MultiUnZip Lib "ZIPSERV.DLL" (ByVal ZipFile As String, ByVal Destination As String, ByVal FilesToUnzip As String, ByVal RestorePath As Integer, ByVal OverWrite As Integer, ByVal WPath As String, ByVal ZPath As String) As Integer
  70. Declare Function ZZip Lib "ZIPSERV.DLL" (ByVal ZipName As String, ByVal FileToZip As String, ByVal pkSwitch As String, ByVal Password As String, ByVal WPath As String, ByVal ZPath As String) As Integer
  71. Declare Function ZipCount Lib "ZIPSERV.DLL" (ByVal ZipFile As String) As Long
  72. Declare Function Zipped Lib "ZIPSERV.DLL" (ByVal ListIndex As Long, ByVal Volume As Integer) As String
  73. Declare Function FoundInSearch Lib "ZIPSERV.DLL" (ByVal item As Integer) As String
  74. Declare Function SearchFor Lib "ZIPSERV.DLL" (ByVal SearchString As String, ByVal Recursive As Integer, ByVal Display As Integer) As Integer
  75. Declare Function GetDrives Lib "ZIPSERV.DLL" () As String
  76. Declare Sub GetWindowPos Lib "ZIPSERV.DLL" (dLeft As Integer, dTop As Integer, dWidth As Integer)
  77. Declare Function AppIsRunning Lib "ZIPSERV.DLL" (ByVal Application As String) As Integer
  78.  
  79.  
  80. 'this call is necessary for loading ZIPSERV.DLL in memory, see at the Form_Load procedure
  81. Declare Function GetSystemDirectory Lib "Kernel" (ByVal lpBuffer$, ByVal nSize%) As Integer
  82. Declare Function GetModuleHandle% Lib "Kernel" (ByVal lpModuleName$)
  83. Declare Function GetModuleUsage% Lib "Kernel" (ByVal hModule%)
  84. Declare Sub FreeModule Lib "Kernel" (ByVal hModule%)
  85.  
  86. Function Convert$ (a$())
  87.      'it converts a string array to a large string that will be passed to
  88.      'ZIPSERV.DLL, between elements with space
  89.      Dim i As Integer
  90.      Dim s$
  91.      s$ = ""
  92.      For i = LBound(a$) To UBound(a$)
  93.          If Len(Trim(a$(i))) > 0 Then
  94.         s$ = s$ + a$(i) + " "
  95.          End If
  96.      Next
  97.      Convert$ = Trim(s$)
  98. End Function
  99.  
  100. Function HomeDrive$ ()
  101.      Dim sc%, nSize%, wp$
  102.      Dim lpBuffer As String * 600
  103.      nSize% = 600
  104.      sc% = GetSystemDirectory(lpBuffer, nSize%)
  105.      If sc% > 0 Then
  106.          wp$ = Left$(lpBuffer, sc%)
  107.          If Right$(wp$, 1) <> "\" Then
  108.         wp$ = wp$ + "\"
  109.          End If
  110.      Else
  111.         wp$ = ""
  112.      End If
  113.      ZipServPath = Environ$("ZipServPath")
  114.      If Len(ZipServPath) > 0 Then
  115.         HomeDrive$ = Left$(ZipServPath, 1) + ":"
  116.      Else
  117.         HomeDrive$ = Left$(wp$, 1) + ":"
  118.      End If
  119. End Function
  120.  
  121.