Article View: borland.public.cppbuilder.nativeapi
Article #11020Re: Delete a file to Recycle Bin
From: Mario Sernicola
Date: Thu, 04 Mar 2004 16:24
Date: Thu, 04 Mar 2004 16:24
34 lines
2294 bytes
2294 bytes
This is my code:
//--------------------------------------------------------------------
if (ListView1->SelCount > 0) {
if (Application->MessageBox(SelectedFilesWillBeDeleted.c_str(),
PROGRAM_NAME, MB_ICONQUESTION + MB_OKCANCEL) == ID_OK)
{
AnsiString files;
int count = 0;
while (count < lvGridOthers->Items->Count)
{
if (lvGridOthers->Items->Item[count]->Selected) {
files +=
ListView1->Items->Item[count]->SubItems->Strings[1];
files += "\0";
}
count++;
}
files += "\0";
SHFILEOPSTRUCT FileOpStr;
ZeroMemory(&FileOpStr, sizeof(FileOpStr));
FileOpStr.hwnd = Application->Handle;
FileOpStr.fFlags = FOF_ALLOWUNDO;
FileOpStr.wFunc = FO_DELETE;
FileOpStr.pFrom = files.c_str();
SHFileOperation(&FileOpStr);
}
}
//--------------------------------------------------------------------
Technical Details
Message-ID:
<40475805@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4045ec37@newsgroups.borland.com> <4045f7da@newsgroups.borland.com> <4046024e@newsgroups.borland.com> <4046092a@newsgroups.borland.com> <40463c2d@newsgroups.borland.com> <40468126$1@newsgroups.borland.com> <4046dd24@newsgroups.borland.com> <4046ECF6.D92243F4@gmx.de> <404733ef@newsgroups.borland.com> <4047365b@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-04 08:40:40 PST Reply-To: "Mario Sernicola" <mariosernicola.nospam@libero.nospam.it> From: "Mario Sernicola" <mariosernicola.nospam@libero.nospam.it> Newsgroups: borland.public.cppbuilder.nativeapi References: <4045ec37@newsgroups.borland.com> <4045f7da@newsgroups.borland.com> <4046024e@newsgroups.borland.com> <4046092a@newsgroups.borland.com> <40463c2d@newsgroups.borland.com> <40468126$1@newsgroups.borland.com> <4046dd24@newsgroups.borland.com> <4046ECF6.D92243F4@gmx.de> <404733ef@newsgroups.borland.com> <4047365b@newsgroups.borland.com> Subject: Re: Delete a file to Recycle Bin Date: Thu, 4 Mar 2004 17:24:14 +0100 Lines: 36 Organization: i'msoft X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 80.183.69.201 Message-ID: <40475805@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1078417413 80.183.69.201 (4 Mar 2004 08:23:33 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail