Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Operating Systems
»
Windows
»
[SOLVED] Delete to recycle bin
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
IndySecOpenSSL is now ava...
by
LeP
[
Today
at 08:54:53 am]
Lazarus Bugfix Release 4....
by
ALLIGATOR
[
Today
at 08:36:44 am]
Interesting video
by
Weiss
[
Today
at 08:16:02 am]
XLibre, finally and fortu...
by
Fred vS
[
Today
at 06:20:26 am]
TDWEdit
by
dbannon
[
Today
at 06:08:28 am]
Conscious Artificial Inte...
by
microxa
[
Today
at 05:43:41 am]
WEBP, no DLLs
by
Tomxe
[
Today
at 04:04:37 am]
How to define a type of ...
by
Fibonacci
[
Today
at 03:22:26 am]
Discipline your AI coding...
by
440bx
[
Today
at 02:44:06 am]
Version 4.8 was recently ...
by
Ten_Mile_Hike
[
Today
at 01:43:17 am]
Who can explain this ?
by
J-G
[
Today
at 01:02:01 am]
FPC Unleashed (inline var...
by
Fibonacci
[
Today
at 12:03:13 am]
[New Component] ExtTabCtr...
by
d7_2_laz
[June 10, 2026, 10:52:55 pm]
Trayslate 1.3.0 - Free tr...
by
AlexanderT
[June 10, 2026, 08:12:24 pm]
TShellListView
by
Ed78z
[June 10, 2026, 07:59:41 pm]
[SOLVED] Curious why this...
by
1HuntnMan
[June 10, 2026, 07:53:21 pm]
Toying Pascal Documenting...
by
paule32
[June 10, 2026, 05:22:32 pm]
Gitlab site history date.
by
Fred vS
[June 10, 2026, 05:07:59 pm]
Cursor changes to arrow o...
by
atlatl
[June 10, 2026, 05:02:45 pm]
Sizes and SizeInt
by
440bx
[June 10, 2026, 02:15:13 pm]
how to add a ForEach call...
by
jamie
[June 10, 2026, 12:42:04 pm]
[SOLVED] Watches panel is...
by
CM630
[June 10, 2026, 12:06:33 pm]
How to monitor changes in...
by
Martin_fr
[June 10, 2026, 11:55:18 am]
Printer Info
by
J-G
[June 10, 2026, 11:26:52 am]
Strange Behaviour at Runt...
by
andrew Bubble
[June 10, 2026, 11:19:45 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] Delete to recycle bin (Read 1682 times)
pcurtis
Hero Member
Posts: 951
[SOLVED] Delete to recycle bin
«
on:
February 06, 2022, 05:25:59 pm »
How can I delete to the recycle bin?
«
Last Edit: February 06, 2022, 06:17:17 pm by pcurtis
»
Logged
Windows 10 20H2
Laz 2.2.0
FPC 3.2.2
rvk
Hero Member
Posts: 7045
Re: Delete to recycle bin
«
Reply #1 on:
February 06, 2022, 05:58:50 pm »
Code: Pascal
[Select]
[+]
[-]
uses
ShellApi
;
procedure
TForm1
.
Button1Click
(
Sender
:
TObject
)
;
begin
SHEmptyRecycleBin
(
Self
.
Handle
,
''
,
SHERB_NOCONFIRMATION
)
;
end
;
Possible flags:
SHERB_NOCONFIRMATION
SHERB_NOPROGRESSUI
SHERB_NOSOUND
Logged
pcurtis
Hero Member
Posts: 951
Re: Delete to recycle bin
«
Reply #2 on:
February 06, 2022, 06:09:17 pm »
How to DELETE TO not empty, but also good to know.
Logged
Windows 10 20H2
Laz 2.2.0
FPC 3.2.2
rvk
Hero Member
Posts: 7045
Re: Delete to recycle bin
«
Reply #3 on:
February 06, 2022, 06:14:52 pm »
Quote from: pcurtis on February 06, 2022, 06:09:17 pm
How to DELETE TO not empty, but also good to know.
Ah, ok, I misread.
Code: Pascal
[Select]
[+]
[-]
uses
ShellApi
;
procedure
DeleteFileToRecycleBin
(
aFile
:
PChar
)
;
var
fileOpStruct
:
TSHFileOpStruct
;
begin
fileOpStruct
.
Wnd
:
=
0
;
fileOpStruct
.
wFunc
:
=
FO_DELETE
;
fileOpStruct
.
pFrom
:
=
aFile
;
fileOpStruct
.
fFlags
:
=
FOF_ALLOWUNDO
+
FOF_NOCONFIRMATION
;
SHFileOperation
(
fileOpStruct
)
;
end
;
Logged
pcurtis
Hero Member
Posts: 951
Re: Delete to recycle bin
«
Reply #4 on:
February 06, 2022, 06:16:26 pm »
Thanks.
Logged
Windows 10 20H2
Laz 2.2.0
FPC 3.2.2
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Operating Systems
»
Windows
»
[SOLVED] Delete to recycle bin
TinyPortal
© 2005-2018