聲明:
PublicTypeSHFILEOPSTRUCT
hwndAsLong
wFuncAsLong
pFromAsString
pToAsString
fFlagsAsInteger
fAnyOperationsAbortedAsLong
hNameMappingsAsLong
lpszProgressTitleAsLong
EndType
PublicDeclareFunctionSHFileOperationLib"shell32.dll"Alias"SHFileOperationA"(lpFileOpAsSHFILEOPSTRUCT)AsLong
PublicConstFO_DELETE=&H3
PublicConstFOF_ALLOWUNDO=&H40
代碼:
DimSHopAsSHFILEOPSTRUCT
DimstrFileasstring
WithSHop
.wFunc=FO_DELETE
.pFrom=strFile Chr(0)
.fFlags=FOF_ALLOWUNDO
EndWith
SHFileOperationSHop->