home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 31 / CDASC_31_1996_juillet_aout.iso / vrac / altd201a.zip / VB4016.ARJ / VB40.16 / EX26VB.FRM < prev    next >
Text File  |  1996-04-19  |  5KB  |  179 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.     Delete.Enabled = 0
  111.     i = 0
  112.     While z(i).size <> -1
  113.         If List1.Selected(i) Then
  114.             z(i).mark = 1
  115.         Else
  116.             z(i).mark = 0
  117.         End If
  118.         i = i + 1
  119.     Wend
  120.     Delete.Enabled = 1
  121.     i = ALDelete(z(), 0, 0, JobProgress.hWnd)
  122.     File1_Click
  123. End Sub
  124.  
  125. Private Sub Extract_Click()
  126.     Dim i As Integer
  127.     Extract.Enabled = 0
  128.     i = 0
  129.     While z(i).size <> -1
  130.         If List1.Selected(i) Then
  131.             z(i).mark = 1
  132.         Else
  133.             z(i).mark = 0
  134.         End If
  135.         i = i + 1
  136.     Wend
  137.     i = ALExtract(z(), 0, 0, 0, JobProgress.hWnd)
  138.     Extract.Enabled = 1
  139. End Sub
  140.  
  141. Private Sub File1_Click()
  142.   Dim i As Integer
  143.   Dim count As Integer
  144.   Dim error As Integer
  145.   
  146.   i = UBound(z, 1)
  147.   If z(i).compressed_size <> 0 Then ALFreeDir z
  148.   ALReadDir z(), File1.filename, count, error
  149.   List1.Clear
  150.   For i = 0 To count - 1
  151.     List1.AddItem z(i).name
  152.   Next
  153. End Sub
  154.  
  155.  
  156. Private Sub Form_Load()
  157.   File1.Path = App.Path
  158.   ChDrive App.Path
  159.   ChDir App.Path
  160.   LibraryHandle = LoadLibrary(DLLName)
  161.   If LibraryHandle < 32 Then
  162.     SSPanel1.Caption = "***ERROR LOADING " + DLLName + "***"
  163.     SSPanel1.FloodType = 0
  164.   End If
  165.   ReDim z(1)
  166. End Sub
  167.  
  168.  
  169. Private Sub Form_Unload(Cancel As Integer)
  170.   FreeLibrary (LibraryHandle)
  171. End Sub
  172.  
  173.  
  174. Private Sub JobProgress_Change()
  175.   SSPanel1.FloodPercent = Val(JobProgress.text)
  176. End Sub
  177.  
  178.  
  179.