1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384
|
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0"; "COMDLG32.OCX"
Begin VB.Form VBUnzFrm
AutoRedraw = -1 'True
Caption = "VBUnzFrm"
ClientHeight = 4785
ClientLeft = 780
ClientTop = 525
ClientWidth = 9375
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "VBUnzFrm"
ScaleHeight = 4785
ScaleWidth = 9375
StartUpPosition = 1 'Fenstermitte
Begin VB.CheckBox checkOverwriteAll
Alignment = 1 'Rechts ausgerichtet
Caption = "Overwrite all?"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 5
Top = 1320
Width = 4425
End
Begin VB.TextBox txtZipFName
BeginProperty Font
Name = "Courier New"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4440
TabIndex = 1
Top = 120
Width = 4335
End
Begin VB.TextBox txtExtractRoot
BeginProperty Font
Name = "Courier New"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4440
TabIndex = 4
Top = 720
Width = 4335
End
Begin VB.CommandButton cmdStartUnz
Caption = "Start"
Height = 495
Left = 240
TabIndex = 6
Top = 1800
Width = 3255
End
Begin VB.TextBox txtMsgOut
BeginProperty Font
Name = "Courier New"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 2175
Left = 240
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 3 'Beides
TabIndex = 8
TabStop = 0 'False
Top = 2520
Width = 8895
End
Begin VB.CommandButton cmdQuitVBUnz
Cancel = -1 'True
Caption = "Quit"
Height = 495
Left = 6240
TabIndex = 7
Top = 1800
Width = 2895
End
Begin VB.CommandButton cmdSearchZfile
Caption = "..."
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 8760
TabIndex = 2
Top = 120
Width = 375
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 4800
Top = 1800
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.Label Label1
Caption = "Complete path-name of Zip-archive:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 0
Top = 120
Width = 3855
End
Begin VB.Label Label2
Caption = "Extract archive into directory:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 3
Top = 720
Width = 3855
End
End
Attribute VB_Name = "VBUnzFrm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'---------------------------------------------------
'-- Please Do Not Remove These Comment Lines!
'----------------------------------------------------------------
'-- Sample VB 5 / VB 6 code to drive unzip32.dll
'-- Contributed to the Info-ZIP project by Mike Le Voi
'--
'-- Contact me at: mlevoi@modemss.brisnet.org.au
'--
'-- Visit my home page at: http://modemss.brisnet.org.au/~mlevoi
'--
'-- Use this code at your own risk. Nothing implied or warranted
'-- to work on your machine :-)
'----------------------------------------------------------------
'--
'-- This Source Code Is Freely Available From The Info-ZIP Project
'-- Web Server At:
'-- ftp://ftp.info-zip.org/pub/infozip/infozip.html
'--
'-- A Very Special Thanks To Mr. Mike Le Voi
'-- And Mr. Mike White
'-- And The Fine People Of The Info-ZIP Group
'-- For Letting Me Use And Modify Their Orginal
'-- Visual Basic 5.0 Code! Thank You Mike Le Voi.
'-- For Your Hard Work In Helping Me Get This To Work!!!
'---------------------------------------------------------------
'--
'-- Contributed To The Info-ZIP Project By Raymond L. King.
'-- Modified June 21, 1998
'-- By Raymond L. King
'-- Custom Software Designers
'--
'-- Contact Me At: king@ntplx.net
'-- ICQ 434355
'-- Or Visit Our Home Page At: http://www.ntplx.net/~king
'--
'---------------------------------------------------------------
'--
'-- Modified August 17, 1998
'-- by Christian Spieler
'-- (added sort of a "windows oriented" user interface)
'-- Modified May 11, 2003
'-- by Christian Spieler
'-- (use late binding for referencing the common dialog)
'-- Modified December 30, 2008
'-- by Ed Gordon
'-- (add Overwrite_All checkbox and resizing of txtMsgOut
'-- output box)
'-- Modified January 03, 2009
'-- by Christian Spieler
'-- (fixed tab navigation sequence, changed passing of
'-- "overwrite-all" setting to use existing option flags,
'-- cleared all msg buffer at start of every DLL call,
'-- removed code that is not supported by VB5)
'--
'---------------------------------------------------------------
Private mCommDlgCtrl As Object
Private Sub cmdStartUnz_Click()
Dim MsgTmp As String
Cls
txtMsgOut.Text = ""
'-- Init Global Message Variables
uZipInfo = ""
uZipMessage = ""
uZipNumber = 0 ' Holds The Number Of Zip Files
'-- Select UNZIP32.DLL Options - Change As Required!
' 1 = Always Overwrite Files
uOverWriteFiles = Me.checkOverwriteAll.Value
' 1 = Prompt To Overwrite
uPromptOverWrite = IIf(uOverWriteFiles = 0, 1, 0)
uDisplayComment = 0 ' 1 = Display comment ONLY!!!
uHonorDirectories = 1 ' 1 = Honour Zip Directories
'-- Select Filenames If Required
'-- Or Just Select All Files
uZipNames.uzFiles(0) = vbNullString
uNumberFiles = 0
'-- Select Filenames To Exclude From Processing
' Note UNIX convention!
' vbxnames.s(0) = "VBSYX/VBSYX.MID"
' vbxnames.s(1) = "VBSYX/VBSYX.SYX"
' numx = 2
'-- Or Just Select All Files
uExcludeNames.uzFiles(0) = vbNullString
uNumberXFiles = 0
'-- Change The Next 2 Lines As Required!
'-- These Should Point To Your Directory
uZipFileName = txtZipFName.Text
uExtractDir = txtExtractRoot.Text
If Len(uExtractDir) <> 0 Then
uExtractList = 0 ' 0 = Extract if dir specified
Else
uExtractList = 1 ' 1 = List Contents Of Zip
End If
'-- Let's Go And Unzip Them!
Call VBUnZip32
'-- Tell The User What Happened
If Len(uZipMessage) > 0 Then
MsgTmp = uZipMessage
uZipMessage = ""
End If
'-- Display Zip File Information.
If Len(uZipInfo) > 0 Then
MsgTmp = MsgTmp & vbNewLine & "uZipInfo is:" & vbNewLine & uZipInfo
uZipInfo = ""
End If
'-- Display The Number Of Extracted Files!
If uZipNumber > 0 Then
MsgTmp = MsgTmp & vbNewLine & "Number Of Files: " & Str(uZipNumber)
End If
txtMsgOut.Text = txtMsgOut.Text & MsgTmp & vbNewLine
End Sub
Private Sub Form_Load()
'-- To work around compatibility issues between different versions of
'-- Visual Basic, we use a late bound untyped object variable to reference
'-- the common dialog ActiveX-control object at runtime.
On Error Resume Next
Set mCommDlgCtrl = CommonDialog1
On Error GoTo 0
'-- Disable the "call openfile dialog" button, when the common dialog
'-- object is not available
cmdSearchZfile.Visible = Not (mCommDlgCtrl Is Nothing)
txtZipFName.Text = vbNullString
txtExtractRoot.Text = vbNullString
Me.Show
End Sub
Private Sub Form_Resize()
Dim Wid As Single
Dim Hei As Single
Wid = Me.Width - 600 ' 9495 - 8895
If Wid < 2000 Then Wid = 2000
txtMsgOut.Width = Wid
Hei = Me.Height - 3120 ' 5295 - 2175
If Hei < 1000 Then Hei = 1000
txtMsgOut.Height = Hei
End Sub
Private Sub Form_Unload(Cancel As Integer)
'-- remove runtime reference to common dialog control object
Set mCommDlgCtrl = Nothing
End Sub
Private Sub cmdQuitVBUnz_Click()
Unload Me
End Sub
Private Sub cmdSearchZfile_Click()
If mCommDlgCtrl Is Nothing Then Exit Sub
mCommDlgCtrl.CancelError = False
mCommDlgCtrl.DialogTitle = "Open Zip-archive"
'-- The following property is not supported in the first version(s)
'-- of the common dialog controls. But this feature is of minor
'-- relevance in our context, so we simply skip over the statement
'-- in case of errors.
On Error Resume Next
mCommDlgCtrl.DefaultExt = ".zip"
On Error GoTo err_deactivateControl
'-- Initialize the file name with the current setting of the filename
'-- text box.
mCommDlgCtrl.FileName = txtZipFName.Text
'-- Provide reasonable filter settings for selecting Zip archives.
mCommDlgCtrl.Filter = "Zip archives (*.zip)|*.zip|All files (*.*)|*.*"
mCommDlgCtrl.ShowOpen
'-- In case the user closed the dialog via cancel, the FilenName
'-- property contains its initial setting and no change occurs.
txtZipFName.Text = mCommDlgCtrl.FileName
Exit Sub
err_deactivateControl:
'-- Emit a warning message.
MsgBox "Unexpected error #" & CStr(Err.Number) & " in call to ComDLG32" _
& " FileOpen dialog:" & vbNewLine & Err.Description & vbNewLine _
& vbNewLine & "The version of the COMDLG32.OCX control installed" _
& " on your system seems to be too old. Please consider upgrading" _
& " to a recent release of the Common Dialog ActiveX control." _
& vbNewLine & "The ""Choose File from List"" dialog functionality" _
& " has been disabled for this session.", _
vbCritical + vbOKOnly, "FileOpen Dialog incompatible"
'-- Deactivate the control and prevent further usage in this session.
Set mCommDlgCtrl = Nothing
cmdSearchZfile.Enabled = False
End Sub
|