| ImageEn, unit iexWindowsFunctions |
|
WindowsMove
WindowsMove
Declaration
function WindowsMove(Handle: HWnd; const FromFilename, DestFolder: string; bRenameOnCollision, bShowConfirmation, bShowProgress: Boolean; bVerboseErrors: Boolean = True): Boolean;
function WindowsMove(Handle: HWnd; ssFiles: TStrings; const DestFolder: string; bRenameOnCollision, bShowConfirmation, bShowProgress: Boolean; bVerboseErrors: Boolean = True): Boolean; overload;
Description
Uses
PerformSHFileOperation to move files to a folder.
| Parameter | Description |
| Handle | Owner Handle. Can specify 0 |
| FromFilename/ssFiles | The file(s) to move. If using FromFileName the multiple files can be delimited using #0 |
| DestFolder | The folder to move files to |
| bRenameOnCollision | Give the file being operated on a new name if a file with the target name already exists at the destination (pertains to FOF_RENAMEONCOLLISION) |
| bShowConfirmation | If not specified then will automatically respond with "Yes to All" for any dialog box that is displayed (undefines FOF_NOCONFIRMATION) |
| bShowProgress | Displays a progress dialog box (undefines FOF_SILENT) |
| bVerboseErrors | Displays a dialog to the user if an error occurs (undefines FOF_NOERRORUI) |
Result is True unless the operation fails or is aborted.
Note: Both files and folders can be specified.
Examples
WindowsMove(Form1.Handle, 'C:\My Image.jpg', 'C:\My Files', True, True, True);
// Move C:\Images to D:\ (the folder D:\Images will be created)
WindowsMove(Form1.Handle, 'C:\Images', 'D:\', True, True, True);