home *** CD-ROM | disk | FTP | other *** search
/ BUG 6 / BUGCD1997_09.BIN / UTIL / ADDZIP / ADDZIP.EXE / VB / ZIPWIZ / ZIP.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-06-01  |  4.7 KB  |  154 lines

  1. VERSION 4.00
  2. Begin VB.Form frmZIP 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Form1"
  5.    ClientHeight    =   1710
  6.    ClientLeft      =   2040
  7.    ClientTop       =   2910
  8.    ClientWidth     =   4830
  9.    Height          =   2115
  10.    Left            =   1980
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   1710
  15.    ScaleWidth      =   4830
  16.    ShowInTaskbar   =   0   'False
  17.    Top             =   2565
  18.    Width           =   4950
  19.    Begin VB.TextBox txtHidden 
  20.       Height          =   375
  21.       Left            =   1920
  22.       TabIndex        =   3
  23.       Text            =   "Text1"
  24.       Top             =   1080
  25.       Visible         =   0   'False
  26.       Width           =   1095
  27.    End
  28.    Begin VB.CommandButton cmdCancel 
  29.       Cancel          =   -1  'True
  30.       Caption         =   "Cancel"
  31.       Height          =   375
  32.       Left            =   240
  33.       TabIndex        =   2
  34.       Top             =   960
  35.       Width           =   1455
  36.    End
  37.    Begin VB.CommandButton cmdOK 
  38.       Caption         =   "OK"
  39.       Default         =   -1  'True
  40.       Height          =   375
  41.       Left            =   3120
  42.       TabIndex        =   1
  43.       Top             =   960
  44.       Width           =   1455
  45.    End
  46.    Begin VB.Label lblInfo 
  47.       Caption         =   "Label1"
  48.       Height          =   495
  49.       Left            =   240
  50.       TabIndex        =   0
  51.       Top             =   240
  52.       Width           =   4215
  53.    End
  54. Attribute VB_Name = "frmZIP"
  55. Attribute VB_Creatable = False
  56. Attribute VB_Exposed = False
  57. Dim iDoZIP As Integer
  58. Sub DoZIP()
  59.     Dim sFiles As String
  60.     Dim I As Long
  61. ' Set the name of the archive
  62.     I = addZIP_ArchiveName(frmWizard!txtArchive.Text)
  63. ' Create pipe-delimited list of files and call the appropriate function
  64.     sFiles = ""
  65.     For I = 0 To frmWizard!lstSelected.ListCount - 1
  66.         sFiles = sFiles & frmWizard!lstSelected.List(I) & "|"
  67.     Next I
  68.     I = addZIP_Include(sFiles)
  69.     If (frmWizard!optFull(0).Value) Then
  70.         I = addZIP_SaveStructure(azSTRUCTURE_ABSOLUTE)
  71.     Else
  72.         I = addZIP_SaveStructure(azSTRUCTURE_NONE)
  73.     End If
  74.     If (frmWizard!optEncrypt(0).Value) Then
  75.         I = addZIP_Encrypt(txtPassword.Text)
  76.     Else
  77.     End If
  78.     If (frmWizard!optLevel(0).Value) Then
  79.         I = addZIP_SetCompressionLevel(azCOMPRESSION_NONE)
  80.     ElseIf (frmWizard!optLevel(1).Value) Then
  81.         I = addZIP_SetCompressionLevel(azCOMPRESSION_MINIMUM)
  82.     ElseIf (frmWizard!optLevel(2).Value) Then
  83.         I = addZIP_SetCompressionLevel(azCOMPRESSION_NORMAL)
  84.     Else
  85.         I = addZIP_SetCompressionLevel(azCOMPRESSION_MAXIMUM)
  86.     End If
  87.     If (frmWizard!optSpan(0).Value) Then
  88.         I = addZIP_Span(True)
  89.     Else
  90.         I = addZIP_Span(False)
  91.     End If
  92.     If (frmWizard!optLFN(0).Value) Then
  93.         I = addZIP_UseLFN(1)
  94.     Else
  95.         I = addZIP_UseLFN(0)
  96.     End If
  97.     If (frmWizard!optComment(0).Value) Then
  98.         I = addZIP_Comment(frmWizard!txtComment.Text)
  99.     End If
  100.     I = addZIP()
  101. End Sub
  102. Private Sub cmdCancel_Click()
  103.     Unload Me
  104. End Sub
  105. Private Sub cmdOK_Click()
  106.     Me.Caption = "Compressing..."
  107.     cmdOK.Visible = False
  108.     cmdCancel.Move (Me.Width - cmdCancel.Width) / 2
  109.     cmdCancel.Enabled = False
  110.     DoZIP
  111.     Me.Caption = "Finished"
  112.     lblInfo.Caption = "Finished"
  113.     cmdCancel.Caption = "OK"
  114.     cmdCancel.Enabled = True
  115. End Sub
  116. Private Sub Form_Load()
  117.     Dim I As Integer
  118.     addZIP_Initialise
  119.     I = addZIP_SetWindowHandle(CLng(txtHidden.Hwnd))
  120.     Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
  121.     Me.Caption = "Confirm"
  122.     lblInfo.Caption = "You are about to start creating the archive. Press OK to proceed, Cancel to quit."
  123.     iDoZIP = 1
  124. End Sub
  125. Private Sub txtHidden_Change()
  126.     Dim sFile As String
  127.         
  128.     Select Case GetAction(txtHidden.Text)
  129.         Case AM_SEARCHING
  130.         Case AM_ZIPCOMMENT
  131.         Case AM_ZIPPING
  132.             sFile = "Compressing " & GetFileName(txtHidden.Text)
  133.             sFile = sFile & " - " & Format$(GetPercentComplete(txtHidden.Text)) & "%"
  134.             lblInfo.Caption = sFile
  135.         Case AM_ZIPPED
  136.         Case AM_UNZIPPING
  137.         Case AM_UNZIPPED
  138.         Case AM_TESTING
  139.         Case AM_TESTED
  140.         Case AM_DELETING
  141.         Case AM_DELETED
  142.         Case AM_DISKCHANGE
  143.         Case AM_VIEW
  144.         Case AM_ERROR
  145.         Case AM_WARNING
  146.         Case AM_QUERYOVERWRITE
  147.         Case AM_COPYING
  148.         Case AM_COPIED
  149.         Case Else
  150.             Debug.Print txtHidden.Text
  151.     End Select
  152.     DoEvents
  153. End Sub
  154.