共用方式為


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
程式庫 Windowscodecs.lib

另請參閱

IWICBitmapCodecProgressNotification

ProgressNotificationCallback