ShowFunctionReplaceDlg(
LPVOID:lpFuncData,
LPTSTR:lpszSourceFile,
LPWIN32_FIND_DATA:pwfdSource,
LPTSTR:lpszDestFile,
LPWIN32_FIND_DATA:pwfdDest,
LPTSTR:lpszNewName,
int:cchNewNameMax,
DWORD:dwFlags
)
→ int
[in] Flags that control the replace dialog. Valid flags are:
| REPLACEDLGF_RESUME | Give the option of resuming the copy |
| REPLACEDLGF_NODESTINFO | No information available for destination file |
| REPLACEDLGF_READONLY | Special prompting for read-only files |
| REPLACEDLGF_NOTHUMBS | Don't display thumbnails in overwrite dialog |
| REPLACEDLGF_NOIDENTICAL | Don't give option to skip identical files |
The return value depends upon the choice made by the user. Valid return values are:
| REPLACERES_ABORT | Copy operation should be aborted |
| REPLACERES_REPLACE | Existing file should be replaced |
| REPLACERES_REPLACEALL | This and all subsequent files should be replaced |
| REPLACERES_SKIP | Skip this file, continue with next file |
| REPLACERES_SKIPALL | Skip this and all subsequent existing files |
| REPLACERES_SKIPIDENTICAL | Skip all identical files |
| REPLACERES_RESUME | Resume copy into destination file |
| REPLACERES_RESUMEALL | Resume this and all subsequent files |
| REPLACERES_RENAME | New name specified for destination file |
The ShowFunctionReplaceDlg function lets you more fully emulate Opus when performing a batch copy operation. It displays the dialog that allows a user to confirm that they wish to overwrite an existing file.
When performing a batch copy operation, you should test if the BATCHF_COPY_ASK_REPLACE flag is set, and if so, check if the destination file already exists. If it does, you should call this function to ask the user for permission to overwrite the file.
If BATCHF_COPY_ASK_REPLACE_RO is set and the existing file has the read-only attribute set, you should call this function with the REPLACEDLGF_READONLY flag set.
If a buffer is provided for lpszNewName then the user will be given the option of providing a new name for the destination file. If the return code is REPLACERES_RENAME you should check if the new filename specified by the user also exists, and if so, call this function again for further confirmation.
If you are able to resume file copies (eg, FTP), you should set the REPLACEDLGF_RESUME flag. If the user elects to resume the copy you should seek to the end of the existing destination file, and to the same relative position in the source file, and continue the copy in append mode.
If the return code is REPLACERES_REPLACEALL, REPLACERES_SKIPALL or REPLACERES_RESUMEALL, you should save this and not prompt the user again for any further existing files (instead, you should replace, skip or resume them as appropriate.)