IWICBitmapCodecProgressNotification::RegisterProgressNotification 方法 (wincodec.h)

注册进度通知回调函数。

语法

HRESULT RegisterProgressNotification(
  [in] PFNProgressNotification pfnProgressNotification,
  [in] LPVOID                  pvData,
  [in] DWORD                   dwProgressFlags
);

参数

[in] pfnProgressNotification

类型: PFNProgressNotification

指向应用程序定义的进度通知回调函数的函数指针。 有关回调签名,请参阅 ProgressNotificationCallback

[in] pvData

类型: LPVOID

指向回调方法的组件数据的指针。

[in] dwProgressFlags

类型:DWORD

用于进度通知的 WICProgressOperationWICProgressNotification 标志。

返回值

类型: HRESULT

如果该方法成功,则返回 S_OK。 否则,将返回 HRESULT 错误代码。

注解

应用程序只能注册单个回调。 后续注册调用将替换以前注册的回调。 若要注销回调,请传入 NULL 或注册新的回调函数。

进度按 0.0 到 1.0 之间的递增顺序报告。 如果 dwProgressFlags 包含 WICProgressNotificationBegin,则保证调用进度为 0.0 的回调。 如果 dwProgressFlags 包含 WICProgressNotificationEnd,则保证使用进度 1.0 调用回调。

WICProgressNotificationFrequent 增加了调用回调的频率。 如果操作预计需要 30 秒以上,则应将 WICProgressNotificationFrequent 添加到 dwProgressFlags

要求

要求
最低受支持的客户端 Windows XP SP2,Windows Vista [桌面应用 |UWP 应用]
最低受支持的服务器 Windows Server 2008 [桌面应用 | UWP 应用]
目标平台 Windows
标头 wincodec.h
Library Windowscodecs.lib

另请参阅

IWICBitmapCodecProgressNotification

ProgressNotificationCallback