IFileOperationNewItem Method

Declares a new item that is to be created in a specified location.

Definition

Namespace: DevCase.Win32.Interfaces
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
HResult NewItem(
	IShellItem psiDestinationFolder,
	FileAttributes dwFileAttributes,
	string pszName,
	string pszTemplateName,
	IFileOperationProgressSink pfopsItem
)

Parameters

psiDestinationFolder  IShellItem
Pointer to an IShellItem that specifies the destination folder that will contain the new item.
dwFileAttributes  FileAttributes
A bitwise value that specifies the file system attributes for the file or folder.
pszName  String
Pointer to the file name of the new item, for instance Newfile.txt. This is a null-terminated, Unicode string.
pszTemplateName  String
Pointer to the name of the template file (for example Excel9.xls) that the new item is based on, stored in one of the following locations:

- CSIDL_COMMON_TEMPLATES. The default path for this folder is %ALLUSERSPROFILE%\Templates.

- CSIDL_TEMPLATES. The default path for this folder is %USERPROFILE%\Templates.

- %SystemRoot%\shellnew

This is a null-terminated, Unicode string used to specify an existing file of the same type as the new file, containing the minimal content that an application wants to include in any new file.

This parameter is normally NULL to specify a new, blank file.

pfopsItem  IFileOperationProgressSink
Pointer to an IFileOperationProgressSink object to be used for status and failure notifications.

If you call Advise(IFileOperationProgressSink, UInt32) for the overall operation, progress status and error notifications for the creation operation are included there, so set this parameter to NULL.

Return Value

HResult
If this method succeeds, it returns S_OK. Otherwise, it returns an HResult error code.

See Also