Microsoft DirectShow 9.0


The GetEvent method retrieves the next event notification from the event queue.


  HRESULT GetEvent(
  long *lEventCode,
  LONG_PTR *lParam1,
  LONG_PTR *lParam2,
  long msTimeout



[out] Pointer to a variable that receives the event code.


[out] Pointer to a variable that receives the first event parameter.


[out] Pointer to a variable that receives the second event parameter.


[in] Time-out interval, in milliseconds. Use INFINITE to block until there is an event.

Return Values

Returns an HRESULT value. Possible values include those shown in the following table.

Return code Description
S_OK Success.
E_ABORT Timeout expired.


If no event is on the queue, this method waits up to msTimeout milliseconds for an event to arrive. Avoid using a time-out interval of INFINITE, because threads cannot process any messages while waiting in GetEvent. If you call GetEvent from the same thread that processes Windows messages, specify only small wait times, in order to remain responsive to user input.

After calling GetEvent, call the IMediaEvent::FreeEventParams method to release any resources allocated for the event parameters.

For a list of notification codes and event parameter values, see Event Notification Codes.

Because this method removes the event from the filter graph event queue, there is no way for multiple clients to monitor events from the same graph.


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

Library: Use Strmiids.lib.

See Also