English
Source / code snippets

Shfileoperation

 

Description:

with the API SHFileOperation can whole Ordner or single Files with Forschrittsanzeige copy, delete (too wastebasket), move or umbenenen.


Deklaration:

Def @SHFileOperation(1) !SHELL32,SHFileOperationA


Parameter:

1.Parameter: Structur or 30 byte large Memory-Variable =>
-byte 0-3 = lever the Fensters, on the the Fortschrittsdialog attend should.
-byte 4-7 = Flag for durchzuführende action => $1 = verschieben; $2=kopieren; $2=löschen; $4=umbenenen
-byte 8-11 = address of/ one Bereichvariablen, The The To modifizierende(n) File(en) or Ordner contains. These Bereichvariable must as conclusion two Nullbytes include. Individual Files or Ordner go with a Nullbyte separated.
-byte 12-15 = address of/ one Bereichvariablen, The The target-File(en) or -ordner contains. These Bereichvariable must as conclusion two Nullbytes include. Individual Files or Ordner go with a Nullbyte separated.
-byte 16-17 = Flag for further Options the durchzuführenden action =>
$40 = If possible go Undoinformationen stored.
$80 = If Wildcards (*.*) uses go, only Files respect.
$1 = there's several Zielordner.
$10 = No Einzelbestätigung.
$200 = the Create one Folder must not confirm go.
$2000 = connected Files not as group move.
$800 = it go no Security attributes copies (NT/2000/XP)
$400 = it'll no Userinterface with one Error outputted.
$1000 = it go no Unterverzeichnisse berücksichtigt (only News directory).
$8 = If Filename already present is, others names give!
$4 = it'll no Fortschrittsdialog displayed.
$100 = only Fortschrittsdialog, none Filenames Show!
$20 = it'll one Mapping Objekt with the middle-aged and new Filenames created, if $8 specify watts and Files umbenannt get.
-byte 18-21 = Rückgabeflag. If the User a action aborted has, standing here 1.
-byte 22-25 = here standing as Return the lever the Mapping Objektes, if $20 specify watts.
-byte 26-29 = The address one Textstrings as Headline for Fortschrittsdialog, if $100 specify watts.


Return Value:

0 with success, 1 with Error.

Examples:

CompileMarkSeparation
Def @SHFileOperation(1) !SHELL32,SHFileOperationA

Proc Fileaction

    Parameters Action$,File$,File2$,noconfirm%,norecycle%
    Parameter 1: Auszuführende Aktion=COPY, DELETE, RENAME, MOVE
    Parameter 2: Quelldatei
    Parameter 3: Zielldatei
    Parameter 4: 0 = User erst fragen, 1= ohne Nachfrage löschen
    Parameter 5: 0 = In Papierkorb verschieben, 1= endgültig löschen
    Declare FOF_Flag%,Action&,DO%,Fehler&
    Declare opstruct#,file#,file2#
    LET DO%=0

    IF @upper$(Action$)=RENAME

        Let Action&=4

    elseIF @upper$(Action$)=COPY

        Let Action&=2

    elseIF @upper$(Action$)=MOVE

        Let Action&=1

    elseIF @upper$(Action$)=DELETE

        Let Action&=3

    else

        @messagebox(Diese Funktion ist nicht bekannt!,Aktion wird nicht ausgeführt!,64)
        LEt DO%=1

    endif

    IF DO%=0

        Case noconfirm% : Let noconfirm%=16
        CaseNot norecycle% : Let norecycle%=64
        Let FOF_Flag% = @or(noconfirm%,norecycle%)
        Dim opstruct#,30
        Dim file#,Add(Len(file$),2)
        Dim file2#,Add(Len(file2$),2)
        String file#,0=@Add$(file$,@Chr$(0))
        String file2#,0=@Add$(file2$,@Chr$(0))
        Long opstruct#,0=%hwnd   Handle des aufrufenden Fensters
        Long opstruct#,4=Action&
        Long opstruct#,8=file#    pfrom : hier der zu löschende Ordner
        Long opstruct#,12=file2#      pto (muß 0 oder eine Bereichvar. mit Zieldateinamen																							 z.B. bei Umbenennung sein
        Word opstruct#,16=FOF_Flag%
        Long opstruct#,18=0	 	Hier steht nach dem Aufruf 1, wenn User abgebrochen hat
        Long opstruct#,22=0	  Unbedingt immer auf Null setzen!
        Long opstruct#,26=0	  Zeiger(Bereich) auf Überschrift des Fortschrittsdialogs
        LET FEHLER&=@ShFileOperation(opstruct#)

        IF @equ(@long(opstruct#,18),1)

            @MessageBox(Die Dateioperation wurde abgebrochen!,Operation abgebrochen!,64)

        ELSEIF @neq(Fehler&,0)

            @MessageBox(Es ist ein Fehler aufgetreten,ShFileOperation +@str$(Fehler&),16)

        EndIf

        Dispose file#
        Dispose file2#
        Dispose opstruct#

    endif

EndProc

REM Beispiel
Fileaction COPY,C:WINDOWS,E:TEMP,0,0
Fileaction DELETE,E:../../Function-References/XProfan/temp/'>TEMP,,1,1
 
03/07/05  
 




J.
Strahl
Hallölle,

nice function The I use The Userprofile on a Stick To copy.

unfortunately there in the Ordner %userprofile%local EinstellungenAnwendungsdatenMicrosoftWindows The File UsrClass.dat which in Benutzung is.
Beimm copy I get The Error Message File can't copy go there tappt im dunkeln in Benutzung is

gives it a Possibility such Files skipping or The The Error Message To bypass ? - After the Error Message fractures the program ex and the remainder won't More copies.

 
Windows 7 Ultimate 64 * 12 GB Ram * XProfan 11.2a * PRFellow * PRFPAD
06/22/08  
 



look time, here stand ? Happen?  [...]  , z.B. FOF_NOCONFIRMATION or FOF_NOERRORUI.
 
06/22/08  
 




Michael
Dell
Hi,

You could whom Ordner Zippen The protected Files stayed then ausen to.

or You launch whom PC with nem second Betriebsystem or Ner Live-CD/DVD and copy whom Ordner complete.

with of/ one DOS-Startdiskette can You, the even if You lfn4dos and eff. ntsf4dos verwendest!

The latest Possibility would The SFP (SystemFileProtection) abzuschalten, of it is though urgently abzuraten, because the hieße direct manipulation the Systems!
 
Salu Michael...

Hab zwar krumme Fieß awer dofir e' ecklich Gsicht! 
06/22/08  
 



I faith SystemFileProtection turn off would it not plenty benefit.

If it it around the Reading the File goes helps vlt. one FileMode on only reading To settle.

Übrigens have I The File UsrClass.Dat not. (xphomesp3)
 
06/22/08  
 




J.
Strahl
Yes, suppa - The thing with the ? Happen? gefällt me Schonmal. important is the weiterkopiert becomes. though have I now no plan where and how I now somewhere one Flag set.

` FOF_NOERRORUI -- Do hardship display a dialog to the user if on error occurs.`

so far clear but whom source properly alter. No plan.. someone of you ?
 
Windows 7 Ultimate 64 * 12 GB Ram * XProfan 11.2a * PRFellow * PRFPAD
06/22/08  
 



of code supra:
CompileMarkSeparation
Word opstruct#,16=FOF_Flag% | ~FOF_NOERRORUI
>
 
06/22/08  
 




J.
Strahl
oha, sorry - bloody Beginner.......

Case noconfirm% : Let noconfirm%=16
Casenote norecycle% : Let norecycle%=64
Let FOF_Flag% = @or(noconfirm%,norecycle%)

I leite time of it ex the the FOF_Flag% yet what sandwich must. but what ?

 
Windows 7 Ultimate 64 * 12 GB Ram * XProfan 11.2a * PRFellow * PRFPAD
06/22/08  
 



Probiers!
 
06/22/08  
 



I have whom supra stehenden code in my NC-Clone already to two years installed. The Parameter can over The to that Program gehörende INI-File verstellt and be the whole functions perfect
 
06/22/08  
 




J.
Strahl


ne ne ne, i don't know I it give should. I have now everything had, direct discontinue without Message. copy without display what copies becomes. but the the Error simply übersprungen becomes, works not. i know there not further, go but of it from that I the eh not schnalle.

I have in the row :

Let FOF_Flag% = @or(noconfirm%,norecycle%)

simply time one + 32 and verchiedene others Opportunities ausprobiert. I come but not the desired Ergebniß. i know simply not and I it neither find can which worth additional there mere must.

@ Horst : I have time to the NC-Clone sought whether I there something find can - unfortunately could I the neither find. höhö

 
Windows 7 Ultimate 64 * 12 GB Ram * XProfan 11.2a * PRFellow * PRFPAD
06/22/08  
 




I have time to the NC-Clone sought whether I there something find can - unfortunately could I the neither find. höhö


where want Thou there search ? - then müsstest You already access To of my Festplatte having - except Jörg had yet whom code of Beta-Test and the faith I do not.
so How in the Image sees it from and has whom code intregiert

213 kB
Hochgeladen:06/22/08
Downloadcounter200
Download
 
06/22/08  
 




Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

6.857 Views

Untitledvor 0 min.
Andre Rohland05/31/19
supernova12/04/13
Christian Hahn07/05/13

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie