Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compiler PBWin 10
#Compile Exe
#Dim All
%Unicode = 1
#Include "Win32API.inc"
Function PBMain() As Long
Local iResult As Long, temp$
temp$ = "c:\_test\z.bas"
If IsFile(temp$) Then
iResult = RecycleBin(temp$)
If iResult Then ? "Failed" Else ? "Succeeded"
Else
? "File not found!"
End If
End Function
Function RecycleBin(temp$) As Long
Local shfo As SHFILEOPSTRUCTW, szSource As WStringZ * %Max_Path
szSource = temp$
shfo.wFunc = %FO_DELETE
shfo.pFrom = VarPtr(szSource)
shfo.fFlags = %FOF_ALLOWUNDO Or %FOF_NOCONFIRMATION
SHFileOperation(shfo)
Function = shfo.fAnyOperationsAborted '%False=worked %True=failed
End Function
'gbs_01276
'Date: 05-11-2013
http://www.garybeene.com/sw/gbsnippets.htm