copying folders using SHFileOperationA
Posted: Tue Oct 11, 2011 8:00 am
I'm trying to add functionality to copy folders. I don't think there's a native way of doing this in JADE so I'm using the SHFileOperationA API call:
The problem I have is that every time I call this, JADE crashes.
I'm pretty sure the problem is that I don't have the data fields right for the SHFILEOPSTRUCT, but I can't see what I'm doing wrong.
Has anyone successfully used the SHFileOperationA API call in JADE?
Code: Select all
copyFolderClient(pS_Source, pS_Dest : String) : Boolean;
constants
FO_COPY : Binary = #2.Binary;
HWnd : Binary = #[00 00 00 00];
DoubleNull : Binary = #[00 00];
Flags : Binary = #[00 00];
Aborted : Binary = #[00 00];
HNameMaps : Binary = #[00 00 00 00];
SProgress : Binary = #[00];
vars
binOp : Binary;
begin
binOp := HWnd & FO_COPY & pS_Source.Binary & DoubleNull & pS_Dest.Binary & DoubleNull & Flags & Aborted & HNameMaps & SProgress;
return call shFileOperation(binOp).Boolean;
end;
I'm pretty sure the problem is that I don't have the data fields right for the SHFILEOPSTRUCT, but I can't see what I'm doing wrong.
Has anyone successfully used the SHFileOperationA API call in JADE?