JCL Help:SHDeleteFiles

From Project JEDI Wiki
Jump to navigationJump to search


Deletes one or more files.


 function SHDeleteFiles(Parent: THandle; const Files: string; Options: TSHDeleteOptions): Boolean;


Parameters Description
Parent: THandle Handle of the window to serve as the parent of any dialogs displayed by this function. Specify GetDesktopWindow to use the desktop as the parent.
const Files: string Files to delete. This can be a single fully qualified filename, a list of files separated by a #0 or a wildcard expression (e.g. *.*). If Files specifies a (single) folder then make sure it is not ended in a backslash. In this latter case, the function deletes all files in the folder and then deletes the folder itself. The folder cannot have subfolders or the function fails.
Options: TSHDeleteOptions Set of options that control the behavior of this function. See TSHDeleteOptions for more information.

Return Value

If the function succeeds the result is True, otherwise it is False.


SHDeleteFiles delete a single file, multiple files or even files specified with a wildcard expression such as *.dcu. If doSilent is not specified the function provides visual feedback of its progress by showing the familiar delete files dialog you also see when deleting files through Explorer. In addition the function allows for deletion to the recycle bin through the doAllowUndo flag.

See Also

TSHDeleteOptions SHDeleteFolder





Marcel van Brakel

Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page