Export (0) Print
Expand All

IFileOperationProgressSink interface

Exposes methods that provide a rich notification system used by callers of IFileOperation to monitor the details of the operations they are performing through that interface.

Members

The IFileOperationProgressSink interface inherits from the IUnknown interface. IFileOperationProgressSink also has these types of members:

Methods

The IFileOperationProgressSink interface has these methods.

MethodDescription
FinishOperations

Performs caller-implemented actions after the last operation performed by the call to IFileOperation is complete.

PauseTimer

Not currently supported.

PostCopyItem

Performs caller-implemented actions after the copy process for each item is complete.

PostDeleteItem

Performs caller-implemented actions after the delete process for each item is complete.

PostMoveItem

Performs caller-implemented actions after the move process for each item is complete.

PostNewItem

Performs caller-implemented actions after the new item is created.

PostRenameItem

Performs caller-implemented actions after the rename process for each item is complete.

PreCopyItem

Performs caller-implemented actions before the copy process for each item begins.

PreDeleteItem

Performs caller-implemented actions before the delete process for each item begins.

PreMoveItem

Performs caller-implemented actions before the move process for each item begins.

PreNewItem

Performs caller-implemented actions before the process to create a new item begins.

PreRenameItem

Performs caller-implemented actions before the rename process for each item begins.

ResetTimer

Not currently supported.

ResumeTimer

Not currently supported.

StartOperations

Performs caller-implemented actions before any specific file operations are performed.

UpdateProgress

Provides an estimate of the total amount of work currently done in relation to the total amount of work.

 

Remarks

When to Implement

Applications must implement IFileOperationProgressSink themselves. Windows does not provide a default implementation.

When to Use

IFileOperationProgressSink are essentially handlers for particular events. They are used normally to display information about the specific action being processed at that time, such as the name of a file, source and destination, and the new name of the item at the destination. Post methods receive the HRESULT of each part of the operation so that the caller can determine specifically where the process fails if it does. IFileOperation method parameter values are passed to the appropriate IFileOperationProgressSink methods so that they have access to the same information.

To attach an implementation of IFileOperationProgressSink to a call to IFileOperation, you have two options:

If you call Advise there is no need to pass IFileOperationProgressSink to specific IFileOperation methods as that results in redundant calls to the IFileOperationProgressSink methods and duplicate notifications.

If you choose to pass IFileOperationProgressSink only to select methods, the same instance of IFileOperationProgressSink can be used for them all.

Example

The following example passes IFileOperationProgressSink to an instance of IFileOperation by calling the Advise method.


IFileOperation *pfo;
CoCreateInstance(CLSID_FileOperation, NULL, CLSCTX_ALL, IID_IFileOperation, (void **)&m_pFO)
HRESULT hr = SHCreateFileOperation(hwnd, 0, IID_PPV_ARGS(&pfo));
if (SUCCEEDED(hr))
{
    // Advise to get notifications
    DWORD dwCookie;
    hr = pfo->Advise(SAFECAST(this, IFileOperationProgressSink*), &dwCookie);
}

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

 

 

Community Additions

ADD
Show:
© 2014 Microsoft