Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to empty the recycle bin Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
18-Sep-02
Category
Shell API
Language
Delphi 6.x
Views
114
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Senn Marco 

How to empty the recycle bin

Answer:

1   procedure EmptyRecycleBin;
2   const
3     SHERB_NOCONFIRMATION = $00000001;
4     SHERB_NOPROGRESSUI = $00000002;
5     SHERB_NOSOUND = $00000004;
6   type
7     TSHEmptyRecycleBin = function(Wnd: HWND; pszRootPath: pChar; dwFlags: DWORD):
8       HRESULT; stdcall;
9   var
10    SHEmptyRecycleBin: TSHEmptyRecycleBin;
11    LibHandle: THandle;
12  begin
13    LibHandle := LoadLibrary(pChar('Shell32.dll'));
14    if LibHandle <> 0 then
15      @SHEmptyRecycleBin := GetProcAddress(LibHandle, 'SHEmptyRecycleBinA');
16    if @SHEmptyRecycleBin <> nil then
17    begin
18      SHEmptyRecycleBin(Application.Handle, nil, SHERB_NOCONFIRMATION or
19        SHERB_NOPROGRESSUI or SHERB_NOSOUND);
20    end;
21    FreeLibrary(LibHandle);
22    @SHEmptyRecycleBin := nil;
23  end;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC