IFileOperation::DeleteItem method (shobjidl_core.h)

Declares a single item that is to be deleted.

Syntax

HRESULT DeleteItem(
  [in] IShellItem                 *psiItem,
  [in] IFileOperationProgressSink *pfopsItem
);

Parameters

[in] psiItem

Type: IShellItem*

Pointer to an IShellItem that specifies the item to be deleted.

[in] pfopsItem

Type: IFileOperationProgressSink*

Pointer to an IFileOperationProgressSink object to be used for progress status and error notifications for this specific delete operation. If you call IFileOperation::Advise for the overall operation, progress status and error notifications for the delete operation are included there, so set this parameter to NULL.

Return value

Type: HRESULT

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

Remarks

This method does not delete the item, it merely declares the item to be deleted. To delete an item, you must make at least the sequence of calls detailed here:

  1. Call IFileOperation::DeleteItem to declare the file or folder to be deleted.
  2. Call IFileOperation::PerformOperations to begin the delete 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::DeleteItems

PostDeleteItem

PreDeleteItem