Board index » delphi » Q:Deleting Files in W95 Recycle Bin (D2)

Q:Deleting Files in W95 Recycle Bin (D2)

Quote
Torsten wrote:
> Hi!

> Can anyone tell me how to delete Files into the Windows 95
> Recycle bin from within a D2 Program?

  Haven't tried this, but....

uses ShellAPI;

function DeleteFileWithUndo(sFileName : string ): boolean;
var
  fos    : TSHFileOpStruct;
begin
  FillChar( fos, SizeOf( fos ), 0 );
  with fos do begin
    wFunc  := FO_DELETE;
    pFrom  := PChar( sFileName );
    fFlags := FOF_ALLOWUNDO or FOF_NOCONFIRMATION
              or FOF_SILENT;
  end;
  Result := ( 0 = ShFileOperation( fos ) );
end;

--
Jason Wallace
SL Software
Dark...@SLSoftware.reno.nv.us
--
"We are MicroSoft.  You will be assimilated.  Resistance is Futile."
--

 

Re:Q:Deleting Files in W95 Recycle Bin (D2)


Hi!

Can anyone tell me how to delete Files into the Windows 95
Recycle bin from within a D2 Program?

Thanks a lot,
Torsten

Re:Q:Deleting Files in W95 Recycle Bin (D2)


you could try using MoveFile to move it to the recycle bin directory.
I don't know if there is a function to get the location of the recycle
bin, but it is *usually* <Drive>:\Recycled.

On Mon, 18 Aug 1997 00:45:04 +0200, Torsten

Quote
<t.vi...@neumuenster.netsurf.de> wrote:
>Hi!

>Can anyone tell me how to delete Files into the Windows 95
>Recycle bin from within a D2 Program?

>Thanks a lot,
>Torsten

Other Threads