General information
Category:
Coding, syntax & commands
About Ed Raul code that I am trying
The message error is
FOF_NOCONFIRMATION not found
This variable is include in SHFileOperation.h, on the bottom of this message
SHFileOperation.h is include in the function below:
I dont know why the error message
*****************************************************
FUNCTION FileOpWithProgressbar
#INCLUDE SHFileOperation.h
LPARAMETERS tcSource, tcDestination, tcAction, tlUserCanceled
LOCAL lcSourceString, lcDestString, nStringBase, lcFileOpStruct, lnFlag, lnStringBase
LOCAL loHeap, lcAction, lnRetCode, llCanceled, laActionList[1]
DECLARE INTEGER SHFileOperation IN SHELL32.DLL STRING @ LPSHFILEOPSTRUCT
SET PROCEDURE TO CLSHEAP ADDITIVE
loHeap = CREATEOBJ('Heap')
lcAction = UPPER(IIF( Empty( tcAction) Or VarType(tcAction) <> "C", "COPY", tcAction))
* Convert Action name into function parameter
ALINES(laActionList, "MOVE,COPY,DELETE,RENAME", ",")
lnAction = ASCAN(laActionList, lcAction)
IF lnAction = 0
* Unknown action
RETURN Null
ENDIF
lcSourceString = tcSource + CHR(0) + CHR(0)
lcDestString = tcDestination + CHR(0) + CHR(0)
lnStringBase = loHeap.AllocBlob(lcSourceString+lcDestString)
lnFlag = FOF_NOCONFIRMATION + FOF_NOCONFIRMMKDIR + FOF_NOERRORUI
lcFileOpStruct = NumToLONG(_screen.hWnd) + ;
NumToLONG(lnAction) + ;
NumToLONG(lnStringBase) + ;
NumToLONG(lnStringBase + LEN(lcSourceString)) + ;
NumToWORD(lnFlag) + ;
NumToLONG(0) + NumToLONG(0) + NumToLONG(0)
lnRetCode = SHFileOperation(@lcFileOpStruct)
* Did user canceled operation?
tlUserCanceled= ( SUBSTR(lcFileOpStruct, 19, 4) <> NumToLONG(0) )
RETURN (lnRetCode = 0)
==============================
file SHFileOperation.h
* Shell File Operations
#DEFINE FO_MOVE 0x0001
#DEFINE FO_COPY 0x0002
#DEFINE FO_DELETE 0x0003
#DEFINE FO_RENAME 0x0004
#DEFINE FOF_MULTIDESTFILES 0x0001
#DEFINE FOF_CONFIRMMOUSE 0x0002
#DEFINE FOF_SILENT 0x0004 && don't create progress/report
#DEFINE FOF_RENAMEONCOLLISION 0x0008
#DEFINE FOF_NOCONFIRMATION 0x0010 && Don't prompt the user.
#DEFINE FOF_WANTMAPPINGHANDLE 0x0020 && Fill in SHFILEOPSTRUCT.hNameMappings
&& Must be freed using SHFreeNameMappings
#DEFINE FOF_ALLOWUNDO 0x0040
#DEFINE FOF_FILESONLY 0x0080 && on *.*, do only files
#DEFINE FOF_SIMPLEPROGRESS 0x0100 && means don't show names of files
#DEFINE FOF_NOCONFIRMMKDIR 0x0200 && don't confirm making any needed dirs
#DEFINE FOF_NOERRORUI 0x0400 && don't put up error UI
#DEFINE FOF_NOCOPYSECURITYATTRIBS 0x0800 && dont copy NT file Security Attributes
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only