Date: 02-16-2022
Return to Index
created by gbSnippets
'Credit: ??
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Include "WIN32API.INC"
Function PBMain()
Local RetVal As Long
RetVal = RecycleBin("C:\MYFILE.TXT")
End Function
Function RecycleBin(FilNam As String) As Long
Local shfo AS SHFILEOPSTRUCT ' predefined structure
Local szSource As AsciiZ * 64
szSource = FilNam + CHR$(0) ' convert to ASCIIZ
shfo.wFunc = %FO_DELETE ' function delete file
shfo.pFrom = VARPTR(szSource) ' pointer to file
shfo.fFlags = %FOF_ALLOWUNDO ' enable undo
dummy& = SHFileOperation(shfo) ' call funtion
Function = shfo.fAnyOperationsAborted ' return value, either 0 or non-zero
End Function
'gbs_00845
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm