IMediaEventEx::SetNotifyWindow

 
Microsoft DirectShow 9.0

IMediaEventEx::SetNotifyWindow

The SetNotifyWindow method registers a window to process event notifications.

Syntax

  HRESULT SetNotifyWindow(
  OAHWND hwnd,
  long lMsg,
  LONG_PTR lInstanceData
);

Parameters

hwnd

[in] Handle to the window, or NULL to stop receiving event messages.

lMsg

[in] Window message to be passed as the notification.

lInstanceData

[in] Value to be passed as the lParam parameter for the lMsg message.

Return Values

Returns S_OK if successful or E_INVALIDARG if the hwnd parameter is not a valid handle to a window.

Remarks

This method designates a window that will process event notifications. Whenever the Filter Graph Manager puts an event in the event queue, it will also post a message to the designated window. The hwnd parameter specifies the window, and the lMsg parameter specifies the message. The application should define a private window message for this purpose. The message's lParam parameter is set to the value of lInstanceData, and the wParam parameter is set to zero.

When the window receives the message, it should call the IMediaEvent::GetEvent method to retrieve the event. Events are asynchronous, so the queue might contain several events (or none). Call GetEvent repeatedly, until it returns an error code.

Requirements

Header: Declared in Control.h; include Dshow.h.

Library: Use Strmiids.lib.

See Also