DirectShow Animated Header -- IMediaEventEx Interface DirectShow Animated Header -- IMediaEventEx Interface* Microsoft DirectShow SDK
*Index  *Topic Contents
*Previous Topic: IMediaEvent Interface
*Next Topic: IMediaEventSink Interface

IMediaEventEx Interface


This interface derives from IMediaEvent and adds a method that allows registration of a window to receive messages when events occur.

When to Implement

This interface is implemented by the filter graph manager.

Unlike IMediaEvent, IMediaEventEx is not available through Automation, and therefore cannot be called directly from Visual Basic.

The CMediaEvent Class supports IMediaEventEx.

When to Use

This interface is used by applications to receive notification that an event has occurred. Applications can then avoid using a separate thread that waits until an event is set.

For a list of system-defined event notifications, see DirectShow Event Notification Codes.

Methods in Vtable Order
IUnknown methods Description
QueryInterface Returns pointers to supported interfaces.
AddRef Increments the reference count.
Release Decrements the reference count.
IDispatch methods Description
GetTypeInfoCount Determines whether there is type information available for this dispinterface.
GetTypeInfo Retrieves the type information for this dispinterface if GetTypeInfoCount returned successfully.
GetIDsOfNames Converts text names of properties and methods (including arguments) to their corresponding DISPIDs.
Invoke Calls a method or accesses a property in this dispinterface if given a DISPID and any other necessary parameters.
IMediaEvent methods Description
GetEventHandle Retrieves a handle to a manual-reset event that will be signaled.
GetEvent Retrieves the next notification event.
WaitForCompletion Waits until the graph's operation has completed.
CancelDefaultHandling Cancels any default handling of the specified event by the filter graph.
RestoreDefaultHandling Restores default handling for this event.
FreeEventParams Frees resources associated with the parameters to an event.
IMediaEventEx methods Description
SetNotifyWindow Registers a window that will handle messages when a specified event occurs.
SetNotifyFlags Turns event notifications on or off.
GetNotifyFlags Retrieves whether event notifications are on or off.


IMediaEventEx::GetNotifyFlags

IMediaEventEx Interface

Retrieves whether event notifications are on or off.

HRESULT GetNotifyFlags(
  [out] long *lplNoNotifyFlags
  );

Parameters
lplNoNotifyFlags
[out] Pointer to a value indicating whether event notifications should be on or off. 0x00 indicates notifications are on and 0x01 indicates notifications are off.
Return Values

Returns an HRESULT value that depends on the implementation of the interface. The current DirectShow implementation returns S_OK if successful or E_POINTER if lplNoNotifyFlags is NULL.

Remarks

The handle returned by the GetEventHandle method will be signaled at end of stream.


IMediaEventEx::SetNotifyFlags

IMediaEventEx Interface

Turns event notifications on or off.

HRESULT SetNotifyFlags(
  long lNoNotifyFlags
  );

Parameters
lNoNotifyFlags
[in] Value indicating whether event notifications should be on or off. Specify 0x00 to turn notifications on or specify 0x01 to turn notification off.
Return Values

Returns an HRESULT value that depends on the implementation of the interface. The current DirectShow implementation returns S_OK if successful or E_INVALIDARG if the argument is invalid.

Remarks

If notification has been turned off, the handle returned by the GetEventHandle method will be signaled at end of stream.


IMediaEventEx::SetNotifyWindow

IMediaEventEx Interface

Registers a window that will handle messages in response to all events from an object.

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

Parameters
hwnd
[in] Handle of window to notify. Pass NULL to stop notification.
lMsg
[in] The window message to be passed as the notification.
lInstanceData
[in] Value (instance data) to be passed as the lParam parameter for the lMsg message.
Return Values

Returns S_OK if successful or E_INVALIDARG if an argument is invalid.

Remarks

This method designates a window as the recipient of messages generated by or sent to the current DirectShow object. You can use this method to monitor the messages from multiple sources in a single window, which lowers processing overhead.

If an event occurs, DirectShow posts the notification message specified in lMsg to the window specified by hwnd. SetNotifyWindow sets the message's lParam parameter to lInstanceData and its wParam parameter to zero.

You can retrieve the event information by calling the GetEvent method when the destination window receives the message.

All event types post the message; when it arrives, any number of events, including zero, might actually be in the queue. If more than one event is in the queue when you call SetNotifyWindow, DirectShow posts only one message. If the application can receive the message after some other action has cleared events from the queue, there might be no events in the queue. For example, the Stop method clears all EC_COMPLETE events from the queue.

© 1998 Microsoft Corporation. All rights reserved. Terms of Use.

*Top of Page