home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 31
/
CDASC_31_1996_juillet_aout.iso
/
vrac
/
altd201a.zip
/
VB30.ARJ
/
VB30
/
EX24VB.FRM
< prev
next >
Wrap
Text File
|
1996-04-19
|
9KB
|
298 lines
VERSION 2.00
Begin Form Form1
Caption = "VB Example 24"
ClientHeight = 4665
ClientLeft = 1260
ClientTop = 1590
ClientWidth = 7485
Height = 5070
Left = 1200
LinkTopic = "Form1"
ScaleHeight = 4665
ScaleWidth = 7485
Top = 1245
Width = 7605
Begin CommandButton UpdateZipComment
Caption = "Update ZIP Comment"
Height = 375
Left = 5280
TabIndex = 21
Top = 600
Width = 2055
End
Begin CommandButton WriteDirectory
Caption = "Write Directory"
Height = 375
Left = 5280
TabIndex = 20
Top = 1080
Width = 2055
End
Begin CommandButton UpdateFileComment
Caption = "Update File Comment"
Height = 375
Left = 5280
TabIndex = 19
Top = 120
Width = 2055
End
Begin TextBox ArchiveComment
Height = 375
Left = 1920
TabIndex = 18
Text = "Archive Comment"
Top = 3240
Width = 1575
End
Begin CommandButton Exit
Caption = "Exit"
Height = 375
Left = 3720
TabIndex = 17
Top = 1080
Width = 1335
End
Begin CommandButton About
Caption = "About"
Height = 375
Left = 3720
TabIndex = 16
Top = 600
Width = 1335
End
Begin TextBox Level
Height = 375
Left = 3840
TabIndex = 15
Text = "Level"
Top = 1680
Width = 1575
End
Begin CheckBox Directory
BackColor = &H80000000&
Caption = "Directory"
Height = 375
Left = 3840
TabIndex = 14
Top = 4200
Width = 1215
End
Begin CheckBox Hidden
BackColor = &H80000000&
Caption = "Hidden"
Height = 375
Left = 3840
TabIndex = 13
Top = 3720
Width = 975
End
Begin CheckBox Sys
BackColor = &H80000000&
Caption = "System"
Height = 375
Left = 3840
TabIndex = 12
Top = 3240
Width = 975
End
Begin CheckBox Archive
BackColor = &H80000000&
Caption = "Archive"
Height = 375
Left = 3840
TabIndex = 11
Top = 2760
Width = 975
End
Begin CheckBox ReadOnly
BackColor = &H80000000&
Caption = "ReadOnly"
Height = 375
Left = 3840
TabIndex = 10
Top = 2280
Width = 1215
End
Begin TextBox TimeStamp
Height = 375
Left = 1920
TabIndex = 9
Text = "TimeStamp"
Top = 2760
Width = 1575
End
Begin TextBox DateStamp
Height = 375
Left = 1920
TabIndex = 8
Text = "DateStamp"
Top = 2280
Width = 1575
End
Begin TextBox crc
Height = 375
Left = 240
TabIndex = 7
Text = "crc"
Top = 4200
Width = 1575
End
Begin TextBox Size
Height = 375
Left = 240
TabIndex = 6
Text = "Size"
Top = 3240
Width = 1575
End
Begin TextBox CompressedSize
Height = 375
Left = 240
TabIndex = 5
Text = "CompressedSize"
Top = 3720
Width = 1575
End
Begin TextBox Comment
Height = 375
Left = 240
TabIndex = 4
Text = "Comment"
Top = 2760
Width = 1575
End
Begin TextBox FileName
Height = 375
Left = 240
TabIndex = 3
Text = "Text1"
Top = 2280
Width = 1575
End
Begin ListBox Contents
Height = 1980
Left = 1800
TabIndex = 2
Top = 120
Width = 1695
End
Begin CommandButton Command1
Caption = "Read Archive"
Height = 375
Left = 3720
TabIndex = 1
Top = 120
Width = 1335
End
Begin FileListBox File1
Height = 1980
Left = 120
Pattern = "*.zip"
TabIndex = 0
Top = 120
Width = 1575
End
Begin SSPanel Panel3D1
BackColor = &H00C0C0C0&
FloodShowPct = 0 'False
Font3D = 0 'None
Height = 5295
Left = 0
TabIndex = 22
Top = 0
Width = 7935
End
End
Dim LibraryHandle As Long
Dim z() As ALZipDir
Sub About_Click ()
frmAbout.Text1 = "EX24VB demonstrates the simplified interface. Double click on a"
frmAbout.Text1 = frmAbout.Text1 + " zip file to display its contents. Selecting individual"
frmAbout.Text1 = frmAbout.Text1 + " files shows the file's attributes. You can change the"
frmAbout.Text1 = frmAbout.Text1 + " file and archive comments by inputing a new comment and"
frmAbout.Text1 = frmAbout.Text1 + " pressing the Update File/ZIP Comment button, then pressing"
frmAbout.Text1 = frmAbout.Text1 + " Write Directory."
frmAbout.Show 1
End Sub
Sub Command1_Click ()
Dim i As Integer
Dim count As Integer
Dim status As Integer
ALFreeDir z()
If File1.FileName <> "" Then
Contents.Clear
ALReadDir z(), File1.FileName, count, status
For i = 0 To count - 1
Contents.AddItem (z(i).name)
Next i
End If
'
' I'm not going to do a WriteDir, a Delete, or
' anything like that, so I'll just free up the
' archive handle right away
'
ArchiveComment.Text = z(UBound(z, 1)).comment
End Sub
Sub Contents_Click ()
Dim i As Integer
i = Contents.ListIndex
If i >= LBound(z, 1) And i <= UBound(z, 1) Then
FileName.Text = z(i).name
comment.Text = z(i).comment
size.Text = Str(z(i).size)
CompressedSize.Text = Str(z(i).compressed_size)
crc.Text = Hex$(Not z(i).crc)
Datestamp.Text = Format(z(i).month, "00/") + Format(z(i).date, "00/") + Format(z(i).year, "0000")
TimeStamp.Text = Format(z(i).hour, "00:") + Format(z(i).minute, "00:") + Format(z(i).second, "00")
If z(i).r <> AL_CLEAR Then ReadOnly.Value = 1 Else ReadOnly.Value = 0
If z(i).a = AL_SET Then archive.Value = 1 Else archive.Value = 0
If z(i).s = AL_SET Then Sys.Value = 1 Else Sys.Value = 0
If z(i).h = AL_SET Then Hidden.Value = 1 Else Hidden.Value = 0
If z(i).d = AL_SET Then Directory.Value = 1 Else Directory.Value = 0
level.Text = Str(Asc(z(i).level))
End If
End Sub
Sub Exit_Click ()
Unload Form1
End
End Sub
Sub File1_DblClick ()
Command1_Click
End Sub
Sub Form_Load ()
ChDrive App.Path
ChDir App.Path
LibraryHandle = LoadLibrary(DLLName())
File1.Path = App.Path
ReDim z(0)
End Sub
Private Sub Form_Unload (Cancel As Integer)
ALFreeDir z()
FreeLibrary (LibraryHandle)
End Sub
Sub UpdateFileComment_Click ()
Dim i As Integer
i = Contents.ListIndex
If i >= LBound(z, 1) And i <= UBound(z, 1) Then
z(i).comment = comment.Text
End If
End Sub
Sub UpdateZipComment_Click ()
z(UBound(z, 1)).comment = ArchiveComment.Text
End Sub
Sub WriteDirectory_Click ()
Dim i As Integer
i = ALWriteDir(z())
End Sub