Export (0) Print
Expand All

IFileOperation::DeleteItem method

Declares a single item that is to be deleted.

Syntax


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

Parameters

psiItem [in]

Type: IShellItem*

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

pfopsItem [in]

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

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Shobjidl.h

IDL

Shobjidl.idl

See also

IFileOperation
IFileOperation::DeleteItems
PreDeleteItem
PostDeleteItem

 

 

Community Additions

ADD
Show:
© 2014 Microsoft