共用方式為


IAudioSessionManager2::UnregisterSessionNotification 方法 (audiopolicy.h)

UnregisterSessionNotification 方法會刪除註冊,以在建立會話時接收通知。

語法

HRESULT UnregisterSessionNotification(
  IAudioSessionNotification *SessionNotification
);

參數

SessionNotification

應用程式實作 IAudioSessionNotification 介面的指標。 將先前呼叫 IAudioSessionManager2::RegisterSessionNotification 中指定的相同介面指標傳遞給會話管理員,以註冊通知。

如果 UnregisterSessionNotification 方法成功,它會在應用程式的 IAudioSessionNotification 介面上呼叫 Release 方法。

傳回值

如果方法成功,它會傳回 S_OK。 如果失敗,可能的傳回碼包括但不限於下表所示的值。

傳回值 描述
E_POINTER
SessionNotificationNULL

備註

當應用程式不再需要接收通知時,應用程式會呼叫此方法。 UnregisterSessionNotification 方法會藉由呼叫 IAudioSessionControl::RegisterAudioSessionNotification 方法,移除應用程式先前向會話管理員註冊的 IAudioSessionNotification 介面註冊。

規格需求

需求
最低支援的用戶端 Windows 7 [僅限傳統型應用程式]
最低支援的伺服器 Windows Server 2008 R2 [僅限桌面應用程式]
目標平台 Windows
標頭 audiopolicy.h

另請參閱

IAudioSessionManager2