How does one use PkZip and PkUnzip dynamically at runtime? In
PbDOS it was easy -- shell with command line.
Using the 32 bit pkUnzip requires user response, which is exactly
what I don't want. The code below (using the old 16 bit pkUnzip)
works, but when extraction is complete, it requires one to click
on the X (exit) at the top right of the screen above the DOS
window. Can this be automated? I find, as in the case of tab
controls, no reference to the subject in Petzold Edition 5.
Any advice will be greatly appreciated!
------------------
PbDOS it was easy -- shell with command line.
Using the 32 bit pkUnzip requires user response, which is exactly
what I don't want. The code below (using the old 16 bit pkUnzip)
works, but when extraction is complete, it requires one to click
on the X (exit) at the top right of the screen above the DOS
window. Can this be automated? I find, as in the case of tab
controls, no reference to the subject in Petzold Edition 5.
Any advice will be greatly appreciated!
Code:
Sub AccessArchive (ByVal Key$) Local cpn As Asciiz*100 Local Opr As Asciiz*10 Local Fle As Asciiz*30 Local Pms As Asciiz*30 Local Dfd As Asciiz*16 QutStg&=2 s$ = CurDir$ ach$=Mid$(mnu$(CurrItem&),79,8) ' e.g., X0018184 - name of a file contained in the Zip file ChDir Left$(lhd$,Len(lhd$)-1) ' destination directory for ' extracted file ' kdd$ below contains (e.g.) \QX00 ' directory containing the zip ' archive ' Opr="open" ' Fle=s$+"\PKZIPW.EXE" 'This calls the 32-bit zipware 'and seems to require ' Pms="-o "+kdd$+"ARCHIVEA "+ach$ 'user response which in this 'case is not wanted ' Dfd="\WpDDT" ' n&=ShellExecute(hDlg&, Opr, Fle, Pms, Dfd, %SW_MAXIMIZE) shl$=s$+"\pkUnzip.Exe -o "+kdd$+"ARCHIVEA "+ach$ '+Chr$(10)+"Exit" 'This calls the old 16-bit 'MsgBox(Left$(lhd$,Len(lhd$)-1)+Chr$(10)+ach$+Chr$(10)+s$+Chr$(10)+shl$) 'PkUnzip (1993 model). 'Exit Sub 'Extracts the file as Shell shl$, 3 'required, but then hangs ChDir s$ '(does not return to continue frf&=FreeFile 'executing subsequent steps until 'one click the EXIT at the 'top right above the DOS window) Open lhd$+ach$ For Binary As frf& Base=0 Seek frf&,0 Get$ frf&,Lof(frf&),f$ Close frf& MsgBox(Str$(Len(f$))) 'Correct file size is shown, Exit Sub 'and the file is in fact If Len(f$)=0 Then (&c)... 'present and correct.
Comment