uses ShellApi;
function DeleteFile_( plik : string ) : boolean;
var
fos : TSHFileOpStruct;
begin
FillChar(fos,sizeof(fos),0);
with fos do
begin
wFunc:=FO_DELETE;
pFrom:=PChar(plik);
fFlags:=FOF_ALLOWUNDO or FOF_NOCONFIRMATION or FOF_NOERRORUI;
end;
Result:=(ShFileOperation(fos)<>0);
end;
|