IFileOperation::CopyItems method (shobjidl_core.h)

Declares a set of items that are to be copied to a specified destination.

Syntax

HRESULT CopyItems(
  [in] IUnknown   *punkItems,
  [in] IShellItem *psiDestinationFolder
);

Parameters

[in] punkItems

Type: IUnknown*

Pointer to the IUnknown of the IShellItemArray, IDataObject, or IEnumShellItems object which represents the group of items to be copied. You can also point to an IPersistIDList object to represent a single item, effectively accomplishing the same function as IFileOperation::CopyItem.

[in] psiDestinationFolder

Type: IShellItem*

Pointer to an IShellItem that specifies the destination folder to contain the copy of the items.

Return value

Type: HRESULT

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

Remarks

This method does not copy the items, it merely declares the items to be copied. To copy a group of items, you must make at least the sequence of calls detailed here:

  1. Call IFileOperation::CopyItems to declare the source items and the destination folder.
  2. Call IFileOperation::PerformOperations to begin the copy operation.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header shobjidl_core.h (include Shobjidl.h)

See also

IFileOperation

IFileOperation::CopyItem