Skip to content

Latest commit

 

History

History
118 lines (96 loc) · 5.85 KB

nn-shobjidl_core-ifileoperationprogresssink.md

File metadata and controls

118 lines (96 loc) · 5.85 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NN:shobjidl_core.IFileOperationProgressSink
IFileOperationProgressSink (shobjidl_core.h)
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.
IFileOperationProgressSink
IFileOperationProgressSink interface [Windows Shell]
IFileOperationProgressSink interface [Windows Shell]
described
_shell_IFileOperationProgressSink
shell.IFileOperationProgressSink
shobjidl_core/IFileOperationProgressSink
shell\IFileOperationProgressSink.htm
shell
24b20e05-d8be-4060-a966-7b32d9225403
12/05/2018
IFileOperationProgressSink, IFileOperationProgressSink interface [Windows Shell], IFileOperationProgressSink interface [Windows Shell],described, _shell_IFileOperationProgressSink, shell.IFileOperationProgressSink, shobjidl_core/IFileOperationProgressSink
shobjidl_core.h
Shobjidl.h
Windows
Windows Vista [desktop apps only]
Windows Server 2008 [desktop apps only]
Shobjidl.idl
Windows
19H1
IFileOperationProgressSink
shobjidl_core/IFileOperationProgressSink
c++
APIRef
kbSyntax
COM
shobjidl_core.h
IFileOperationProgressSink

IFileOperationProgressSink interface

-description

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.

-inheritance

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

-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);
}

-see-also

IFileOperation