Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
function RecycleDelete(whndle: THandle; inpath: string): integer;
{ deletes 'inpath', removing it to the recycle bin. You can specify a list
of files, as long as you put #0 between the files, and double-terminate it
with #0. }
var
FileOp: TSHFileOpStructA;
begin
inpath := inpath + #0;
with FileOp do
begin
wnd := whndle;
wFunc := FO_DELETE; //FO_COPY, FO_DELETE, FO_MOVE, FO_RENAME
pFrom := PChar(inpath);
fFlags := FOF_ALLOWUNDO or FOF_NOCONFIRMATION;
fAnyOperationsAborted := false;
hNameMappings := nil;
lpszProgressTitle := nil;
end;
Result := SHFileOperationA(FileOp);
{ at this point, if you allow confirmation, you can interrogate
FileOp.fAnyOperationsAborted to determine if the user aborted your operation.
}
end;
function SHEmptyRecycleBin(Wnd:HWnd; pszRootPath:PChar; pwFlags:Word):Integer;
stdcall; external 'SHELL32.DLL' name 'SHEmptyRecycleBinA';
function EmptyRecycleBin(Confirm: Boolean): integer;
const
SHERB_NOCONFIRMATION = $00000001;
SHERB_NOPROGRESSUI = $00000002;
SHERB_NOSOUND = $00000004;
begin
if Confirm then
Result := SHEmptyRecycleBin(0, nil, 0)
else
Result := SHEmptyRecycleBin(0, nil, SHERB_NOCONFIRMATION);
end;