home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 31 / CDASC_31_1996_juillet_aout.iso / vrac / altd201a.zip / VB30.ARJ / VB30 / EX26VB.FRM < prev    next >
Text File  |  1996-04-19  |  5KB  |  179 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Form1"
  5.    ClientHeight    =   4770
  6.    ClientLeft      =   2115
  7.    ClientTop       =   1515
  8.    ClientWidth     =   3870
  9.    Height          =   5175
  10.    Left            =   2055
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   4770
  13.    ScaleWidth      =   3870
  14.    Top             =   1170
  15.    Width           =   3990
  16.    Begin CommandButton About 
  17.       Caption         =   "About"
  18.       Height          =   495
  19.       Left            =   240
  20.       TabIndex        =   7
  21.       Top             =   3960
  22.       Width           =   1455
  23.    End
  24.    Begin CommandButton Extract 
  25.       Caption         =   "Extract"
  26.       Height          =   495
  27.       Left            =   240
  28.       TabIndex        =   6
  29.       Top             =   3360
  30.       Width           =   1455
  31.    End
  32.    Begin CommandButton DelButt 
  33.       Caption         =   "Delete"
  34.       Height          =   495
  35.       Left            =   2040
  36.       TabIndex        =   5
  37.       Top             =   3360
  38.       Width           =   1335
  39.    End
  40.    Begin CommandButton Command1 
  41.       Caption         =   "Exit"
  42.       Height          =   495
  43.       Left            =   2040
  44.       TabIndex        =   4
  45.       Top             =   3960
  46.       Width           =   1335
  47.    End
  48.    Begin ListBox List1 
  49.       Height          =   2175
  50.       Left            =   2040
  51.       MultiSelect     =   2  'Extended
  52.       TabIndex        =   1
  53.       Top             =   240
  54.       Width           =   1335
  55.    End
  56.    Begin FileListBox File1 
  57.       Height          =   2175
  58.       Left            =   240
  59.       Pattern         =   "*.zip"
  60.       TabIndex        =   0
  61.       Top             =   240
  62.       Width           =   1455
  63.    End
  64.    Begin SSPanel SSPanel1 
  65.       BackColor       =   &H00C0C0C0&
  66.       FloodType       =   1  'Left To Right
  67.       Font3D          =   0  'None
  68.       Height          =   375
  69.       Left            =   480
  70.       TabIndex        =   3
  71.       Top             =   2520
  72.       Width           =   2655
  73.    End
  74.    Begin TextBox JobProgress 
  75.       Height          =   375
  76.       Left            =   480
  77.       TabIndex        =   2
  78.       Text            =   "Job Progress -I'm invisible, dude"
  79.       Top             =   2880
  80.       Visible         =   0   'False
  81.       Width           =   2655
  82.    End
  83.    Begin SSPanel Panel3D1 
  84.       BackColor       =   &H00C0C0C0&
  85.       FloodShowPct    =   0   'False
  86.       Font3D          =   0  'None
  87.       Height          =   4935
  88.       Left            =   0
  89.       TabIndex        =   8
  90.       Top             =   0
  91.       Width           =   3975
  92.    End
  93. End
  94.  
  95. Option Explicit
  96. Dim z() As ALZipDir
  97. Dim LibraryHandle As Long
  98.  
  99. Sub About_Click ()
  100. frmAbout.Text1 = "EX26VB demonstrates the simplified interface.  Double click on a"
  101. frmAbout.Text1 = frmAbout.Text1 + " zip file to display its contents.  You can either"
  102. frmAbout.Text1 = frmAbout.Text1 + " extract or delete the file from the archive."
  103. frmAbout.Show 1
  104.  
  105. End Sub
  106.  
  107. Sub Command1_Click ()
  108.     Unload Form1
  109.     End
  110. End Sub
  111.  
  112. Sub Command2_Click ()
  113.  
  114. End Sub
  115.  
  116. Sub DelButt_Click ()
  117.     Dim i As Integer
  118.     DelButt.Enabled = 0
  119.     i = 0
  120.     While z(i).size <> -1
  121.         If List1.Selected(i) Then
  122.             z(i).mark = 1
  123.         Else
  124.             z(i).mark = 0
  125.         End If
  126.         i = i + 1
  127.     Wend
  128.     DelButt.Enabled = 1
  129.     i = ALDelete(z(), 0, 0, JobProgress.hWnd)
  130.     File1_Click
  131. End Sub
  132.  
  133. Sub Extract_Click ()
  134.     Dim i As Integer
  135.     Extract.Enabled = 0
  136.     i = 0
  137.     While z(i).size <> -1
  138.         If List1.Selected(i) Then
  139.             z(i).mark = 1
  140.         Else
  141.             z(i).mark = 0
  142.         End If
  143.         i = i + 1
  144.     Wend
  145.     i = ALExtract(z(), 0, 0, 0, JobProgress.hWnd)
  146.     Extract.Enabled = 1
  147. End Sub
  148.  
  149. Sub File1_Click ()
  150.   Dim i As Integer
  151.   Dim count As Integer
  152.   Dim status As Integer
  153.   
  154.   i = UBound(z, 1)
  155.   If z(i).compressed_size <> 0 Then ALFreeDir z()
  156.   ALReadDir z(), File1.FileName, count, status
  157.   List1.Clear
  158.   For i = 0 To count - 1
  159.     List1.AddItem z(i).name
  160.   Next
  161. End Sub
  162.  
  163. Sub Form_Load ()
  164.   File1.Path = App.Path
  165.   ChDrive App.Path
  166.   ChDir App.Path
  167.   LibraryHandle = LoadLibrary(DLLName())
  168.   ReDim z(1)
  169. End Sub
  170.  
  171. Sub Form_Unload (Cancel As Integer)
  172.   FreeLibrary (LibraryHandle)
  173. End Sub
  174.  
  175. Sub JobProgress_Change ()
  176.   SSPanel1.FloodPercent = Val(JobProgress.Text)
  177. End Sub
  178.  
  179.