home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Power Pack / Visual_Basic4_Power_Pack.bin / vb4files / pkunexap / unzip.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-11-20  |  7.0 KB  |  222 lines

  1. VERSION 4.00
  2. Begin VB.Form frmMain 
  3.    Caption         =   "Zipping Test Form"
  4.    ClientHeight    =   3300
  5.    ClientLeft      =   2580
  6.    ClientTop       =   1980
  7.    ClientWidth     =   7170
  8.    Height          =   3720
  9.    Icon            =   "UNZIP.frx":0000
  10.    Left            =   2520
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   3300
  13.    ScaleWidth      =   7170
  14.    Top             =   1620
  15.    Width           =   7290
  16.    Begin VB.Frame Frame1 
  17.       Height          =   3270
  18.       Left            =   0
  19.       TabIndex        =   0
  20.       Top             =   0
  21.       Width           =   7155
  22.       Begin VB.CommandButton btnGetCC 
  23.          Caption         =   "Get C&&C Files"
  24.          Height          =   435
  25.          Left            =   5670
  26.          TabIndex        =   16
  27.          Top             =   840
  28.          Width           =   1380
  29.       End
  30.       Begin VB.TextBox txtTextFile 
  31.          Height          =   285
  32.          Left            =   1785
  33.          TabIndex        =   15
  34.          Text            =   "*.txt;*.doc"
  35.          Top             =   2835
  36.          Width           =   3690
  37.       End
  38.       Begin VB.TextBox txtMissionIni 
  39.          Height          =   285
  40.          Left            =   1785
  41.          TabIndex        =   13
  42.          Text            =   "Mission.ini"
  43.          Top             =   2520
  44.          Width           =   3690
  45.       End
  46.       Begin VB.TextBox txtSaveGameName 
  47.          Height          =   285
  48.          Left            =   1785
  49.          TabIndex        =   12
  50.          Text            =   "SaveGame.*"
  51.          Top             =   2205
  52.          Width           =   3690
  53.       End
  54.       Begin VB.FileListBox fileZipName 
  55.          Height          =   450
  56.          Left            =   1470
  57.          Pattern         =   "*.zip"
  58.          TabIndex        =   9
  59.          Top             =   945
  60.          Width           =   4005
  61.       End
  62.       Begin VB.FileListBox fileExtracted 
  63.          Height          =   645
  64.          Left            =   1470
  65.          TabIndex        =   8
  66.          Top             =   1470
  67.          Width           =   4005
  68.       End
  69.       Begin VB.TextBox txtExtractToPath 
  70.          Height          =   285
  71.          Left            =   1470
  72.          TabIndex        =   2
  73.          Text            =   "c:\c&c\temp"
  74.          Top             =   630
  75.          Width           =   4005
  76.       End
  77.       Begin VB.CommandButton btnExtract 
  78.          Caption         =   "&Extract Files"
  79.          Default         =   -1  'True
  80.          Height          =   540
  81.          Left            =   5670
  82.          TabIndex        =   3
  83.          Top             =   210
  84.          Width           =   1380
  85.       End
  86.       Begin VB.TextBox txtPKPath 
  87.          Height          =   285
  88.          Left            =   1470
  89.          TabIndex        =   1
  90.          Text            =   "c:\zipper\pkunzip.exe"
  91.          Top             =   315
  92.          Width           =   4005
  93.       End
  94.       Begin VB.Label Label8 
  95.          Caption         =   "Text File"
  96.          Height          =   225
  97.          Left            =   105
  98.          TabIndex        =   14
  99.          Top             =   2835
  100.          Width           =   1590
  101.       End
  102.       Begin VB.Label Label7 
  103.          Caption         =   "Mission Ini:"
  104.          Height          =   225
  105.          Left            =   105
  106.          TabIndex        =   11
  107.          Top             =   2520
  108.          Width           =   1590
  109.       End
  110.       Begin VB.Label Label6 
  111.          Caption         =   "Save Game FileName:"
  112.          Height          =   225
  113.          Left            =   105
  114.          TabIndex        =   10
  115.          Top             =   2205
  116.          Width           =   1590
  117.       End
  118.       Begin VB.Label Label5 
  119.          Caption         =   "Files Extracted:"
  120.          Height          =   225
  121.          Left            =   105
  122.          TabIndex        =   7
  123.          Top             =   1470
  124.          Width           =   1275
  125.       End
  126.       Begin VB.Label Label4 
  127.          AutoSize        =   -1  'True
  128.          Caption         =   "Extract To Path:"
  129.          Height          =   195
  130.          Left            =   105
  131.          TabIndex        =   6
  132.          Top             =   630
  133.          Width           =   1275
  134.       End
  135.       Begin VB.Label Label3 
  136.          AutoSize        =   -1  'True
  137.          Caption         =   "Zip File:"
  138.          Height          =   195
  139.          Left            =   105
  140.          TabIndex        =   5
  141.          Top             =   945
  142.          Width           =   1290
  143.       End
  144.       Begin VB.Label Label2 
  145.          AutoSize        =   -1  'True
  146.          Caption         =   "PKUNZIP Path:"
  147.          Height          =   195
  148.          Left            =   105
  149.          TabIndex        =   4
  150.          Top             =   315
  151.          Width           =   1275
  152.       End
  153.    End
  154. Attribute VB_Name = "frmMain"
  155. Attribute VB_Creatable = False
  156. Attribute VB_Exposed = False
  157. Option Explicit
  158. Private Sub btnExtract_Click()
  159. Dim PKPath$, ZipPath$, ExToPath$, CommandLine$
  160. Dim I As Long, J As Long
  161. Dim Ret As Boolean
  162. 'Store the various user inputs into varibles
  163. PKPath = UCase(txtPKPath.Text)
  164. ZipPath = "D:\ARCHIVES\" & UCase(fileZipName.List(fileZipName.ListIndex))
  165. ExToPath = UCase(txtExtractToPath.Text)
  166. 'Delete all files in ExToPath, then we can get the unzipped name
  167. 'If you dont unzip to an empty directory you might get the wrong files returned
  168. 'This line assumes every file is okay to be deleted
  169. Kill ExToPath & "\*.*"
  170. fileExtracted.Path = ExToPath
  171. 'Combine the varibles and command line stings to
  172. 'run pkunzip as you would from dos
  173. ' -o -en overwrites anything thats there and extracts in name order
  174. 'change if needed
  175. CommandLine = PKPath & " -o -en " & ZipPath & " " & ExToPath
  176. MsgBox CommandLine
  177. Ret = ShellAndClose(CommandLine)
  178. If Ret = False Then
  179.     MsgBox "An error occured in the shelling process"
  180. End If
  181. 'Click the get CC files
  182. btnGetCC.Value = True
  183. End Sub
  184. Private Sub btnGetCC_Click()
  185. 'Get SaveGame file
  186. fileExtracted.Pattern = "SaveGame.*"
  187. fileExtracted.Refresh
  188. If fileExtracted.ListCount <> 0 Then
  189.     txtSaveGameName.Text = fileExtracted.List(0)
  190.     txtSaveGameName.Text = "File Not Found"
  191. End If
  192. 'Get Mission.ini
  193. fileExtracted.Pattern = "Mission.Ini"
  194. fileExtracted.Refresh
  195. If fileExtracted.ListCount <> 0 Then
  196.     txtMissionIni.Text = fileExtracted.List(0)
  197.     txtMissionIni.Text = "File Not Found"
  198. End If
  199. 'Get txt and/or doc file
  200. fileExtracted.Pattern = "*.txt"
  201. fileExtracted.Refresh
  202. If fileExtracted.ListCount <> 0 Then
  203.     txtTextFile.Text = fileExtracted.List(0)
  204.     fileExtracted.Pattern = "*.doc"
  205.     fileExtracted.Refresh
  206.     If fileExtracted.ListCount <> 0 Then
  207.         txtTextFile.Text = fileExtracted.List(0)
  208.     Else
  209.         txtTextFile.Text = "No files found"
  210.     End If
  211. End If
  212. fileExtracted.Pattern = "*.*"
  213. End Sub
  214. Private Sub fileZipName_DblClick()
  215. btnExtract.Value = True
  216. End Sub
  217. Private Sub Form_Load()
  218. fileZipName.Path = "D:\archives"
  219. 'Set up file box
  220. fileExtracted.Pattern = "*.*"
  221. End Sub
  222.