| |
|
|
Uwe ''Pascal'' Niemeier | Hi people!
here two Minimal-Examples (without Fehlerabfrage), How one mithilfe the ocx3a-routines The windows-internen zipper-functions benefit can.
File or Ordner pack: CompileMarkSeparationwindow 200,200
$H Windows.ph
$H ocx3a.ph
$I ocx3a.inc
var Quelle$="C:2Test"---existierende Datei oder Ordner
var Ziel$="C:Test.zip"--anzulegende Datei
declare a#:dim a#,24:clear a#
byte a#,0=80,75,5,6
blockwrite Ziel$,a#,0,24--leere Zip-Datei erzeugen
dispose a#
ocxInit()
var Shell&=ocxCreate("Shell.Application")
var Ziel&=ocxMethod(Shell&,"NameSpace",Ziel$)--ZIP wird von Windows wie Ordner behandelt
ocxMethod(Ziel&,"CopyHere",Quelle$)------------Quelle nach Pseudo-"Ordner" kopieren
set("ErrorLevel",0)---Komprimieren arbeitet asynchron, darum Statusabfrage nötig
while 1
sleep 50
case filesize(Ziel$)>-1:break--Datei "fertig", sonst Größe = -1
print Time$(1)
endwhile
set("ErrorLevel",1)
ocxRelease(Ziel&,Shell&)
print "Fertig"
ocxDeInit()
waitkey
ZIP-File entpacken: CompileMarkSeparationwindow 200,200
$H windows.ph
$H ocx3a.ph
$I ocx3a.inc
var fountain$="C:Test.zip"--existing zipper-File
var target$="C:1Test"-------existierender Zielordner
ocxInit()
var Shell&=ocxCreate("Shell.Application")
var Ziel&=ocxMethod(Shell&,"NameSpace",target$)
var Quelle&=ocxMethod(Shell&,"NameSpace",fountain$)
var Items&=ocxMethod(Quelle&,"Items")
ocxMethod(Ziel&,"CopyHere",Items&)
--Entpacken operates synchron, therefore no Statusabfrage necessary (?)
print "Fertig"
ocxRelease(Items&,Ziel&,Quelle&,Shell&)
ocxDeInit()
waitkey
The Codes behaviour itself just as as windows-Originale, d.h. with large Files appear a Fortschrittsanzeige and at Entpacken becomes possibly demand, whether existing Files überschrieben go should.
PS: If the ocx-routines directly to Calling the functions de-Initialisiert go (How in this Demos), can itself whom appeal of ocxRelease() save, because yet apertured ocx-Objects through ocxDeInit() automatically released go.
SeeYou Pascal |
|
|
| |
|
|
|
Dieter Zornow | super made, have you got too time attempts a Zipdatei with Password To entpacken, becomes there automatically nachgefragt or supported The Windowsroutine not. |
|
|
| Er ist ein Mann wie ein Baum. Sie nennen ihn Bonsai., Win 7 32 bit und Win 7 64 bit, mit XProfan X2 | 12/27/09 ▲ |
|
|
|
|
Sato Pinto | Hello
by me brich at unpacken the Program ex
greeting Sato |
|
|
| |
|
|
|
Uwe ''Pascal'' Niemeier | Hi people!
@ Dieter: at that Entpacken becomes in the doing with want to one Password gefragt; at pack not, because windows this even not self supported.
@ Sato: No Error Message? attempt time by $D rauszukriegen, wos klemmt and red you The contents the verwendeten variables Show.
SeeYou Pascal |
|
|
| |
|
|
|
Sato Pinto | Hello Pascal
loudly $D The row causes whom Programabruch ocxMethod(Ziel&,"CopyHere",Items&)
greeting Sato |
|
|
| |
|
|
|
Uwe ''Pascal'' Niemeier | Hi Sato!
If Ziel& and Items& not zero are, ought to it klappen otherwise could you to and/or to "CopyHere" time one Sleep 200 or so bring into action. might one Timing-trouble his.
@ All: has otherwise yet someone Problems with this functions?
SeeYou Pascal |
|
|
| |
|
|
|
| i am pleased first on it, correctly. angucken can I first bisl later. |
|
|
| |
|
|
|
Sato Pinto | Hello
with The Sleep command functions lovely, thanks
greeting Sato |
|
|
| |
|
|