The IMediaEventEx interface derives from method that allows registration of a window to receive messages when events occur.
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.
Applications use this interface 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 Event Notification Codes.
Methods in Vtable Order
IUnknown methods Description QueryInterface Retrieves 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.
Retrieves whether event notifications are on or off.
Syntax
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 Value
Returns an HRESULT value that depends on the implementation of the interface. The current Microsoft® 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.
Turns event notifications on or off.
Syntax
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 Value
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.
Registers a window that will handle messages in response to all events from an object.
Syntax
HRESULT SetNotifyWindow(
OAHWND hwnd,
long lMsg,
long lInstanceData
);
Parameters
- hwnd
- [in] Handle of window to notify. Pass NULL to stop notification.
- lMsg
- [in] 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 Value
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.
Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.