hab ich mir grade mal ausgeben lassen, er sagt, das
handle ist ungültig!
allerdings düfte er gar nicht in den block kommen, wenn es ungültig wäre!
hier nochmal der aktuelle quelltext:
Delphi-Quellcode:
function TForm1.transferdateiinfos(source,destination: widestring): boolean;
var
NewCreationTime, NewAccessTime, NewWriteTime: TFileTime;
hFind_s, hFind_d: THandle;
FindFileData_s, FindFileData_d: WIN32_FIND_DATAW;
begin
result := false;
if source[length(source)] = '\' then setlength(source,length(source)-1);
if destination[length(destination)] = '\' then setlength(destination,length(destination)-1);
hFind_s := FindFirstFileW(PWideChar(source),FindFileData_s);
hFind_d := FindFirstFileW(PWideChar(destination),FindFileData_d);
if (hFind_s <> INVALID_HANDLE_VALUE) and (hFind_d <> INVALID_HANDLE_VALUE) then begin
try
findfiledata_d.dwFileAttributes := findfiledata_s.dwFileAttributes;
result := GetFileTime(hFind_s, @NewCreationTime, @NewAccessTime, @NewWriteTime);
ShowMessage(SysErrorMessage(GetLastError));
result := SetFileTime(hFind_d, @NewCreationTime, @NewAccessTime, @NewWriteTime);
finally
Windows.FindClose(hFind_s);
Windows.FindClose(hFind_d);
end;
end;
end;