CONST FO_DELETE = &H3
CONST FOF_NOCONFIRMATION = &H10
CONST FOF_ALLOWUNDO = &H40
TYPE SHFILEOPSTRUCT
hWnd AS LONG
wFunc AS LONG
pFrom AS LONG
pTo AS LONG
fFlags AS INTEGER
fAborted AS LONG
hNameMaps AS LONG
sProgress AS LONG
END TYPE
DECLARE FUNCTION SHFileOperationAPI LIB "shell32" ALIAS _
"SHFileOperationA" (lpFileOp AS SHFILEOPSTRUCT) AS LONG
DIM s AS STRING, t AS STRING
s = FileName & NULL & NULL
t = NULL & NULL
DIM shOP AS SHFILEOPSTRUCT
shOP.hwnd = Application.Handle
shOP.wFunc = FO_DELETE
shOP.fFlags = FOF_NOCONFIRMATION OR FOF_ALLOWUNDO
shOP.pFrom = VARPTR(s)
shOP.pTo = VARPTR(t)
SHFileOperationAPI(shOP)
|