home *** CD-ROM | disk | FTP | other *** search
/ In'side Shareware 1995 April / ish0495.iso / win95 / zipserv / zipserv.vb_ / zipserv.vb
Text File  |  1995-06-21  |  6KB  |  86 lines

  1. '  Visual Basic declarations section for dynamic-link library : ZIPSERV.DLL
  2. '  ADD This module to your Visual Basic project
  3. 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
  4.     'ZipName      - the name of the ZipFile, like "C:\MY\CONRAD.ZIP", with the complete path
  5.     'FileToZip    - the name of the file to zip including the path, wild characters allowed
  6.     'Keep         - True (non zero) when the originak date at update to be kept in the Zip file
  7.     'Store        - True (non zero) when the path is to be stored in the Zip file
  8.     'Recur        - True (non zero) when recursive subdirectories in the Zip file
  9.     'Pword        - Password (if any)
  10.     'WPath        - A Path for the ZipServer that can be used as working area (read\Write access)
  11.     'ZPath        - Normally the Windows\System directory, or the directory where the "ZIPSERV.LIC" file was installed
  12.     '               if a Null string is passed the Windows\System directory will be taken
  13.     'ReturnValue  - Zero (0) for success, or call ZipError(ReturnValue) for more details
  14. 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
  15.     'Identical names have the same meaning as for Zip
  16.     'Dest         - The Destination directory where the file(s) to be unzipped
  17.     'F2Unzip      - The name of the file including path that to be unzipped. Wild characters are allowed.
  18.     'Rest         - True (non zero) when the stored path in the Zip file is to be restored
  19.     'OW           - True (non zero) when existing files are to be overwritten
  20. Declare Function ZipError Lib "ZIPSERV.DLL" (ByVal ErrCode As Integer) As String
  21. Declare Function DriveType Lib "ZIPSERV.DLL" (ByVal DriveLetter As String) As Integer
  22.     '0            - drive not found
  23.     '2            - floppy disk drive
  24.     '3            - hard disk drive
  25.     '4            - remote drive (network drive)
  26. Declare Function DropCombo Lib "ZIPSERV.DLL" (ByVal hWnd As Integer) As Integer
  27. Declare Function FromIni Lib "ZIPSERV.DLL" (ByVal Ininame As String, ByVal Section As String, ByVal Request As String) As String
  28.     'Ininame      - name including the full path for the INI file
  29.     'Section      - name of the section in the INI file (section name is in [ ] brackets)
  30.     'Request      - the name of the parameter (left side value)
  31. Declare Function FromWinIni Lib "ZIPSERV.DLL" (ByVal Appname As String, ByVal Request As String, ByVal Default As String) As String
  32.     'Appname      - the name of the section in WIN.INI
  33.     'Default      - the default value of Request which will be written and returned if there is no other value avaiable
  34. Declare Function WinPath Lib "ZIPSERV.DLL" () As String
  35. Declare Function WinSysPath Lib "ZIPSERV.DLL" () As String
  36. Declare Function WriteWinIni Lib "ZIPSERV.DLL" (ByVal Appname As String, ByVal Request As String, ByVal Value As String) As Integer
  37.     'ReturnValue = 0 if success
  38. Declare Function WriteIni Lib "ZIPSERV.DLL" (ByVal Ininame As String, ByVal Section As String, ByVal Request As String, ByVal Value As String) As Integer
  39.     'ReturnValue = 0 if success
  40. Declare Function RemoveIniLine Lib "ZIPSERV.DLL" (ByVal Ininame As String, ByVal Section As String, ByVal Request As String) As Integer
  41.     'ReturnValue = 0 if success
  42. Declare Function RemoveIniSection Lib "ZIPSERV.DLL" (ByVal Ininame As String, ByVal Section As String) As Integer
  43.     'ReturnValue = 0 if success
  44. Declare Sub ReadOnlyTextBox Lib "ZIPSERV.DLL" (ByVal hWnd As Integer)
  45.     'hWnd         - the textbox's hWnd property value
  46. Declare Sub StayOnTop Lib "ZIPSERV.DLL" (ByVal hWnd As Integer, ByVal status As Integer)
  47.     'hWnd property of the form
  48.     'status = 0   - do not stay on top
  49.     'status <>0   - stay on top
  50. Declare Sub DisplayTextFile Lib "ZIPSERV.DLL" (ByVal Textfile As String, ByVal Title As String, ByVal hWndParent As Integer, ByVal ReadOnly As Integer)
  51.     'Textfile     - the name including the full path of the textfile to be displayed
  52.     'Title        - the title of the display
  53.     'hWndParent   - the hWnd property value of the form from the calling application
  54.     'ReadOnly     - True (non zero) value results in read only display
  55. Declare Function ExtractBase Lib "ZIPSERV.DLL" (ByVal File As String) As String
  56.     'File         - the name including the full path of a file
  57. Declare Function ExtractPath Lib "ZIPSERV.DLL" (ByVal File As String) As String
  58. Declare Function ExtractFile Lib "ZIPSERV.DLL" (ByVal File As String) As String
  59. 'this call is necessary for loading ZIPSERV.DLL in memory, see at the Form_Load procedure
  60. Declare Function GetSystemDirectory Lib "Kernel" (ByVal lpBuffer$, ByVal nSize%) As Integer
  61. Declare Sub AddZipComment Lib "ZIPSERV.DLL" (ByVal ZipFile As String, ByVal Comment As String)
  62. Declare Function GetZipComment Lib "ZIPSERV.DLL" (ByVal ZipFile As String) As String
  63. Declare Sub DisplayProcess Lib "ZIPSERV.DLL" (ByVal status As INTEGER)
  64.  
  65. Function HomeDrive$ ()
  66.      Dim sc%, nSize%, wp$
  67.      Dim lpBuffer As String * 600
  68.      nSize% = 600
  69.      sc% = GetSystemDirectory(lpBuffer, nSize%)
  70.      If sc% > 0 Then
  71.          wp$ = Left$(lpBuffer, sc%)
  72.          If Right$(wp$, 1) <> "\" Then
  73.         wp$ = wp$ + "\"
  74.          End If
  75.      Else
  76.         wp$ = ""
  77.      End If
  78.      ZipServPath = Environ$("ZipServPath")
  79.      If Len(ZipServPath) > 0 Then
  80.         HomeDrive$ = Left$(ZipServPath, 1) + ":"
  81.      Else
  82.         HomeDrive$ = Left$(wp$, 1) + ":"
  83.      End If
  84. End Function
  85.  
  86.