reference:plugins:plugin_sdk:batch_mode_functions:showfunctionnewnamedlg

ShowFunctionNewNameDlg(
     LPVOID:lpFuncData,
     LPTSTR:lpszOldName,
     int:cchOldNameMax,
     LPTSTR:lpszNewName,
     int:cchNewNameMax,
     BOOL:fMove
)
→ int

Arguments

lpFuncData

[in] The value of the lpFuncData member of the VFSBATCHDATA structure

lpszOldName

[in,out] On input, this must contain the original name of the file. When this function returns the buffer may contain the "old" name wildcard pattern if the user enters one.

cchOldNameMax

[in] The size of the lpszOldName buffer in characters

lpszNewName

[in,out] On input, this must contain the default new name of the file (normally, the same as the original name.) When this function returns this buffer may contain the "new" name wildcard pattern if the user enters one.

cchNewNameMax

[in] The size of the lpszNewName buffer in characters

fMove

[in] Set to TRUE if this is a move operation or FALSE for a copy operation

Return value

The return value depends upon the choice made by the user. Valid return values are:

NEWNAME_ABORTCopy operation should be aborted
NEWNAME_SKIPSkip the current file, continue with the next file
NEWNAME_SIMPLENo wildcard pattern was entered
NEWNAME_WILDA wildcard pattern was entered

Description

The ShowFunctionNewNameDlg function lets you more fully emulate Opus when performing a batch copy operation. It displays the dialog that allows a user to rename files as they are copied or moved.

You should only call this function if the BATCHF_COPY_RENAME flag is set in the VFSBATCHDATA structure, indicating that the user wishes to perform a Copy As or Move As function.

If the return value is NEWNAME_SIMPLE, the user did not enter a wildcard pattern. You should therefore use the value of lpszNewName as the new name of the file (note that the user may still have edited the new name.) You should then call this function again for the next file.

If the return value is NEWNAME_WILD, the user entered a wildcard pattern. You should save the contents of lpszOldName and lpszNewName, and use the GetWildNewName function to get the real new name of each file being copied or moved. Once the user has entered a wildcard pattern they should not be asked for a new name again for the duration of the batch operation.