ShellApi.pas;
...
FUNCTION RecycleFile(CONST AFile: STRING): boolean;
VAR
foStruct: TSHFileOpStruct;
BEGIN
WITH foStruct DO BEGIN
wnd := 0;
wFunc := FO_DELETE;
pFrom := PChar(AFile + #0#0);
pTo := NIL;
fFlags := FOF_ALLOWUNDO OR FOF_NOCONFIRMATION OR FOF_SILENT;
fAnyOperationsAborted := false;
hNameMappings := NIL;
END;
Result := SHFileOperation(foStruct) = 0;
END;
No hay comentarios:
Publicar un comentario