home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / WINDOWS / ALTD201A.ZIP / VB30.ZIP / VB30 / EX24VB.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-04-19  |  8.7 KB  |  284 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "VB Example 24"
  4.    ClientHeight    =   4665
  5.    ClientLeft      =   1260
  6.    ClientTop       =   1590
  7.    ClientWidth     =   7485
  8.    Height          =   5070
  9.    Left            =   1200
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   4665
  12.    ScaleWidth      =   7485
  13.    Top             =   1245
  14.    Width           =   7605
  15.    Begin CommandButton UpdateZipComment 
  16.       Caption         =   "Update ZIP Comment"
  17.       Height          =   375
  18.       Left            =   5280
  19.       TabIndex        =   21
  20.       Top             =   600
  21.       Width           =   2055
  22.    End
  23.    Begin CommandButton WriteDirectory 
  24.       Caption         =   "Write Directory"
  25.       Height          =   375
  26.       Left            =   5280
  27.       TabIndex        =   20
  28.       Top             =   1080
  29.       Width           =   2055
  30.    End
  31.    Begin CommandButton UpdateFileComment 
  32.       Caption         =   "Update File Comment"
  33.       Height          =   375
  34.       Left            =   5280
  35.       TabIndex        =   19
  36.       Top             =   120
  37.       Width           =   2055
  38.    End
  39.    Begin TextBox ArchiveComment 
  40.       Height          =   375
  41.       Left            =   1920
  42.       TabIndex        =   18
  43.       Text            =   "Archive Comment"
  44.       Top             =   3240
  45.       Width           =   1575
  46.    End
  47.    Begin CommandButton Exit 
  48.       Caption         =   "Exit"
  49.       Height          =   375
  50.       Left            =   3720
  51.       TabIndex        =   17
  52.       Top             =   1080
  53.       Width           =   1335
  54.    End
  55.    Begin CommandButton About 
  56.       Caption         =   "About"
  57.       Height          =   375
  58.       Left            =   3720
  59.       TabIndex        =   16
  60.       Top             =   600
  61.       Width           =   1335
  62.    End
  63.    Begin TextBox Level 
  64.       Height          =   375
  65.       Left            =   3840
  66.       TabIndex        =   15
  67.       Text            =   "Level"
  68.       Top             =   1680
  69.       Width           =   1575
  70.    End
  71.    Begin CheckBox Directory 
  72.       BackColor       =   &H80000000&
  73.       Caption         =   "Directory"
  74.       Height          =   375
  75.       Left            =   3840
  76.       TabIndex        =   14
  77.       Top             =   4200
  78.       Width           =   1215
  79.    End
  80.    Begin CheckBox Hidden 
  81.       BackColor       =   &H80000000&
  82.       Caption         =   "Hidden"
  83.       Height          =   375
  84.       Left            =   3840
  85.       TabIndex        =   13
  86.       Top             =   3720
  87.       Width           =   975
  88.    End
  89.    Begin CheckBox Sys 
  90.       BackColor       =   &H80000000&
  91.       Caption         =   "System"
  92.       Height          =   375
  93.       Left            =   3840
  94.       TabIndex        =   12
  95.       Top             =   3240
  96.       Width           =   975
  97.    End
  98.    Begin CheckBox Archive 
  99.       BackColor       =   &H80000000&
  100.       Caption         =   "Archive"
  101.       Height          =   375
  102.       Left            =   3840
  103.       TabIndex        =   11
  104.       Top             =   2760
  105.       Width           =   975
  106.    End
  107.    Begin CheckBox ReadOnly 
  108.       BackColor       =   &H80000000&
  109.       Caption         =   "ReadOnly"
  110.       Height          =   375
  111.       Left            =   3840
  112.       TabIndex        =   10
  113.       Top             =   2280
  114.       Width           =   1215
  115.    End
  116.    Begin TextBox TimeStamp 
  117.       Height          =   375
  118.       Left            =   1920
  119.       TabIndex        =   9
  120.       Text            =   "TimeStamp"
  121.       Top             =   2760
  122.       Width           =   1575
  123.    End
  124.    Begin TextBox DateStamp 
  125.       Height          =   375
  126.       Left            =   1920
  127.       TabIndex        =   8
  128.       Text            =   "DateStamp"
  129.       Top             =   2280
  130.       Width           =   1575
  131.    End
  132.    Begin TextBox crc 
  133.       Height          =   375
  134.       Left            =   240
  135.       TabIndex        =   7
  136.       Text            =   "crc"
  137.       Top             =   4200
  138.       Width           =   1575
  139.    End
  140.    Begin TextBox Size 
  141.       Height          =   375
  142.       Left            =   240
  143.       TabIndex        =   6
  144.       Text            =   "Size"
  145.       Top             =   3240
  146.       Width           =   1575
  147.    End
  148.    Begin TextBox CompressedSize 
  149.       Height          =   375
  150.       Left            =   240
  151.       TabIndex        =   5
  152.       Text            =   "CompressedSize"
  153.       Top             =   3720
  154.       Width           =   1575
  155.    End
  156.    Begin TextBox Comment 
  157.       Height          =   375
  158.       Left            =   240
  159.       TabIndex        =   4
  160.       Text            =   "Comment"
  161.       Top             =   2760
  162.       Width           =   1575
  163.    End
  164.    Begin TextBox FileName 
  165.       Height          =   375
  166.       Left            =   240
  167.       TabIndex        =   3
  168.       Text            =   "Text1"
  169.       Top             =   2280
  170.       Width           =   1575
  171.    End
  172.    Begin ListBox Contents 
  173.       Height          =   1980
  174.       Left            =   1800
  175.       TabIndex        =   2
  176.       Top             =   120
  177.       Width           =   1695
  178.    End
  179.    Begin CommandButton Command1 
  180.       Caption         =   "Read Archive"
  181.       Height          =   375
  182.       Left            =   3720
  183.       TabIndex        =   1
  184.       Top             =   120
  185.       Width           =   1335
  186.    End
  187.    Begin FileListBox File1 
  188.       Height          =   1980
  189.       Left            =   120
  190.       Pattern         =   "*.zip"
  191.       TabIndex        =   0
  192.       Top             =   120
  193.       Width           =   1575
  194.    End
  195.    Begin SSPanel Panel3D1 
  196.       BackColor       =   &H00C0C0C0&
  197.       FloodShowPct    =   0   'False
  198.       Font3D          =   0  'None
  199.       Height          =   5295
  200.       Left            =   0
  201.       TabIndex        =   22
  202.       Top             =   0
  203.       Width           =   7935
  204.    End
  205. Dim LibraryHandle As Long
  206. Dim z() As ALZipDir
  207. Sub About_Click ()
  208.   frmAbout.Text1 = "EX24VB demonstrates the simplified interface.  Double click on a"
  209.   frmAbout.Text1 = frmAbout.Text1 + " zip file to display its contents.  Selecting individual"
  210.   frmAbout.Text1 = frmAbout.Text1 + " files shows the file's attributes.  You can change the"
  211.   frmAbout.Text1 = frmAbout.Text1 + " file and archive comments by inputing a new comment and"
  212.   frmAbout.Text1 = frmAbout.Text1 + " pressing the Update File/ZIP Comment button, then pressing"
  213.   frmAbout.Text1 = frmAbout.Text1 + " Write Directory."
  214.   frmAbout.Show 1
  215. End Sub
  216. Sub Command1_Click ()
  217.     Dim i As Integer
  218.     Dim count As Integer
  219.     Dim status As Integer
  220.     ALFreeDir z()
  221.     If File1.FileName <> "" Then
  222.         Contents.Clear
  223.         ALReadDir z(), File1.FileName, count, status
  224.         For i = 0 To count - 1
  225.             Contents.AddItem (z(i).name)
  226.         Next i
  227.     End If
  228. ' I'm not going to do a WriteDir, a Delete, or
  229. ' anything like that, so I'll just free up the
  230. ' archive handle right away
  231.   ArchiveComment.Text = z(UBound(z, 1)).comment
  232. End Sub
  233. Sub Contents_Click ()
  234.     Dim i As Integer
  235.     i = Contents.ListIndex
  236.     If i >= LBound(z, 1) And i <= UBound(z, 1) Then
  237.         FileName.Text = z(i).name
  238.         comment.Text = z(i).comment
  239.         size.Text = Str(z(i).size)
  240.         CompressedSize.Text = Str(z(i).compressed_size)
  241.         crc.Text = Hex$(Not z(i).crc)
  242.         Datestamp.Text = Format(z(i).month, "00/") + Format(z(i).date, "00/") + Format(z(i).year, "0000")
  243.         TimeStamp.Text = Format(z(i).hour, "00:") + Format(z(i).minute, "00:") + Format(z(i).second, "00")
  244.         If z(i).r <> AL_CLEAR Then ReadOnly.Value = 1 Else ReadOnly.Value = 0
  245.         If z(i).a = AL_SET Then archive.Value = 1 Else archive.Value = 0
  246.         If z(i).s = AL_SET Then Sys.Value = 1 Else Sys.Value = 0
  247.         If z(i).h = AL_SET Then Hidden.Value = 1 Else Hidden.Value = 0
  248.         If z(i).d = AL_SET Then Directory.Value = 1 Else Directory.Value = 0
  249.         level.Text = Str(Asc(z(i).level))
  250.     End If
  251. End Sub
  252. Sub Exit_Click ()
  253.   Unload Form1
  254.   End
  255. End Sub
  256. Sub File1_DblClick ()
  257.     Command1_Click
  258. End Sub
  259. Sub Form_Load ()
  260.     ChDrive App.Path
  261.     ChDir App.Path
  262.     LibraryHandle = LoadLibrary(DLLName())
  263.     File1.Path = App.Path
  264.     ReDim z(0)
  265. End Sub
  266. Private Sub Form_Unload (Cancel As Integer)
  267.   ALFreeDir z()
  268.   FreeLibrary (LibraryHandle)
  269. End Sub
  270. Sub UpdateFileComment_Click ()
  271.     Dim i As Integer
  272.     i = Contents.ListIndex
  273.     If i >= LBound(z, 1) And i <= UBound(z, 1) Then
  274.         z(i).comment = comment.Text
  275.     End If
  276. End Sub
  277. Sub UpdateZipComment_Click ()
  278.   z(UBound(z, 1)).comment = ArchiveComment.Text
  279. End Sub
  280. Sub WriteDirectory_Click ()
  281.     Dim i As Integer
  282.     i = ALWriteDir(z())
  283. End Sub
  284.