Skip to content

Latest commit

 

History

History
56 lines (36 loc) · 1.97 KB

File metadata and controls

56 lines (36 loc) · 1.97 KB

Home

Function name : SHFileOperation

Group: Shell Functions - Library: shell32


Copies, moves, renames, or deletes a file system object.


Code examples:

Deleting files into the Recycle Bin
Displaying standard progress dialog box when copying files
How to remove a directory that is not empty

Declaration:

int SHFileOperation(
	LPSHFILEOPSTRUCT lpFileOp
);  

FoxPro declaration:

DECLARE INTEGER SHFileOperation IN Shell32;
	STRING @lpFileOp  

Parameters:

lpFileOp [in] Address of an SHFILEOPSTRUCT structure that contains information this function needs to carry out the specified operation.


Return value:

Returns zero if successful, or nonzero otherwise.


Comments:

You should use fully-qualified pathnames with this function. Using it with relative path-names is not thread-safe.

When used to delete a file, SHFileOperation will attempt to place the deleted file in the Recycle Bin. If you wish to delete a file and guarantee that it will not be placed in the Recycle Bin, use DeleteFile.

While operating on a file this function displays a standard progress dialog box unless the FOF_SILENT flag is set in fFlags. The lpszProgressTitle parameter sets the title of this dialog.

See also: CopyFile, CopyFileTransacted, MoveFile, MoveFileTransacted, DeleteFile, DeleteFileTransacted.