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

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