* SHFileOperation() Delete usage example: * Windows doesn't require user intervention to confirm the deletions. * Progress dialog will appear in the current active window if it takes * long enough to fire the dialog; may be idle and unresponsive for a * while with no errors. If you let the conformation dialog run, it * pops nearly instantly. * * ClsHeap can be found in the Files section * DECLARE INTEGER SHFileOperation IN SHELL32.DLL STRING @ LPSHFILEOPSTRUCT DECLARE INTEGER GetActiveWindow IN WIN32API SET PROCEDURE TO CLSHEAP ADDITIVE oHeap = CREATEOBJ('Heap') cVBNull = CHR(0) #DEFINE FO_DELETE 3 #DEFINE FOF_NOCONFIRMATION 0x10 && Don't prompt the user. #DEFINE FOF_FILESONLY 0x80 && Don't nail subfolders. * Explicitly declare a full path to avoid the vagaries of exactly what * Windows is using to resolve the path, each file spec ends with a * terminating null, with the last one double null terminated cSourceString = 'C:\MyDir\*.BAK' + cVBNull + ; 'C:\YourDir\YourFileName.TXT' + cVBNull + ; 'C:\MyDir\MyTempDBF.*' + cVBNull + cVBNull nStringBase = oHeap.AllocBlob(cSourceString) cFileOpStruct = NumToDWORD(GetActiveWindow()) + ; NumToDWORD(FO_DELETE) + ; NumToDWORD(nStringBase) + ; NumToDWORD(0) + ; NumToDWORD(FOF_NOCONFIRMATION) + ; cVBNull + ; NumToDWORD(0) + ; NumToDWORD(0) IF SHFileOperation(@cFileOpStruct) = 0 * It worked ELSE * It didn't ENDIF IF SUBST(cFileOpStruct,21,1) # cVBNull * Some part of the operation was aborted or failed ENDIF oHeap = ''