🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #10995

Re: Delete a file to Recycle Bin

#10995
From: nicolasr
Date: Wed, 03 Mar 2004 15:15
32 lines
1792 bytes
Hi,

use SHFileOperation() instead. It is passed a SHFILEOPSTRUCT
structure that you initialize with FO_DELETE and FOF_ALLOWUNDO
to delete to the recycle bin.

hth,
Nick

> Hi,
>
> I've to implement a function that delete a file and put it in the recycle
> bin.
>
> I've used SHGetSpecialFolder function to retrieve the path of recycle bin
> folder and move the file in it, but it is ever an empty string.
>
> //---------------------------------------------------------------
>     char path[MAX_PATH+1];
>
>      try
>     {
>             if (SHGetSpecialFolderPath(Handle, path, CSIDL_BITBUCKET, 0))
>                 //code to copy file to recycle bin path
>      } catch (...) {//error message}
> //---------------------------------------------------------------
>
> Thanks
>
> Mario Sernicola
>
>
Technical Details
Message-ID: <4045f6aa$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4045ec37@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,820b8d6a3def1656
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-03-03 07:41:51 PST
From: "nicolasr" <nicolasrNOSPAMATSIGNgmx.net>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4045ec37@newsgroups.borland.com>
Subject: Re: Delete a file to Recycle Bin
Date: Wed, 3 Mar 2004 16:15:50 +0100
Lines: 34
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 80.133.177.191
Message-ID: <4045f6aa$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1078326954 80.133.177.191 (3 Mar 2004 07:15:54 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail