DirectX SDK

IDirectMusicPerformance::SetNotificationHandle

The IDirectMusicPerformance::SetNotificationHandle method sets the event handle (created by the Microsoft® Win32® CreateEvent function) for notifications. The application should use the Win32 WaitForSingleObject function on this handle. When signaled, the application should call the IDirectMusicPerformance::GetNotificationPMsg method to retrieve the notification event.

HRESULT SetNotificationHandle(
  HANDLE hNotification,
  REFERENCE_TIME rtMinimum
);

Parameters

hNotification
Event handle created by CreateEvent, or 0 to clear out an existing handle.
rtMinimum
Minimum time that the performance should hold onto old notify events before discarding them. The value 0 means to use the default minimum time of 20,000,000 reference time units, which is 2 seconds, or the previous value if this method has been called previously. If the application has not called GetNotificationPMsg by this time, the event is discarded to free the memory.

Return Values

The method returns S_OK.

Remarks

It is the application's responsibility to call the Win32 CloseHandle function on the notification handle when it is no longer needed.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in dmusici.h.

See Also

Notification and Event Handling