recycle bin
Posted: Fri Dec 06, 2024 4:52 pm
Is there a possibility to delete files/directories into the recycle bin in windows?
Code: Select all
#FOF_NOERRORUI = $400
Procedure RecycleFile(file$)
m=AllocateMemory(Len(file$)+2)
If m
PokeS(m,file$) : SHFileOp.SHFILEOPSTRUCT : SHFileOp\pFrom=m : SHFileOp\wFunc=#FO_DELETE
SHFileOp\fFlags=#FOF_ALLOWUNDO|#FOF_NOERRORUI : ok=SHFileOperation_(SHFileOp) : FreeMemory(m)
If ok=0 : ok=1 : Else : ok=0 : EndIf
EndIf
ProcedureReturn ok
EndProcedure
RecycleFile("YourFile.txt") ; <== change this to your file.