The IMMDeviceHandler class is the base handler class for IMMDevices and provides behavior common to all devices. IMMDeviceHandler inherits from IHandler. It inherits dispatchHandlerEvent virtual function from IHandler to encapsulate the multimedia interface. This function does four things. First, it determines what message has been received and converts it into the appropriate event. Second, it determines which device the event is for. Third, it calls the virtual function for the event. Fourth, it goes through the list of added IObservers for the device and calls the IObserver::dispatchNotificationEvent with the event.
You can construct and destruct objects of this class.
![]() |
public:
virtual ~IMMDeviceHandler()
Windows | OS/2 | AIX |
Yes | Yes | No |
![]() |
public:
IMMDeviceHandler()
Windows | OS/2 | AIX |
Yes | Yes | No |
Use these members to attach and detach the handler object to and from a given device.
![]() |
public:
virtual IMMDeviceHandler& handleEventsFor( IMMDevice* device )
Attaches the handler to the specified IMMDevice object.
Windows | OS/2 | AIX |
Yes | Yes | No |
![]() |
public:
virtual IMMDeviceHandler& stopHandlingEventsFor( IMMDevice* device )
Detaches the handler from the specified IMMDevice object.
Windows | OS/2 | AIX |
Yes | Yes | No |
Event-dispatching members evaluate an event to determine if it is appropriate for this handler object to process. If it is, these members call the virtual function used to process the event.
![]() |
protected:
virtual bool dispatchHandlerEvent(IEvent& event)
This function does four things. First, it determines what message has been received and converts it into the appropriate event. Second, it determines which device the event is for. Third, it calls the virtual function for the event. Fourth, it goes through the list of added IObservers for the device and calls the IObserver::dispatchNotificationEvent with the event.
A given handler should return true if the event should not be dispatched to other handlers. In such cases, a result can be placed in the specified IEvent object.
Windows | OS/2 | AIX |
Yes | Yes | No |
Derived classes must supply these members to process a device, position change, pass, or cue point event.
![]() |
public:
virtual bool cuePoint(const IMMCuePointEvent& event)
Implemented by derived classes to process cuePoint events.
Windows | OS/2 | AIX |
Ignored | Yes | No |
![]() |
public:
virtual bool deviceEvent(const IMMDeviceEvent& event)
Implemented by derived classes to process device events.
Windows | OS/2 | AIX |
Yes | Yes | No |
![]() |
public:
virtual bool passDevice(const IMMPassDeviceEvent& event)
Implemented by derived classes to process pass device events.
Windows | OS/2 | AIX |
Ignored | Yes | No |
![]() |
public:
virtual bool positionChange( const IMMPositionChangeEvent& event )
Implemented by derived classes to process position change events.
Windows | OS/2 | AIX |
Yes | Yes | No |
virtual ~IHandler()
virtual IString asDebugInfo() const
virtual IString asString() const
virtual IHandler& disable()
virtual IHandler& enable(bool enable = true)
virtual IHandler& handleEventsFor(IWindow* window)
IHandler()
bool isEnabled() const
virtual IHandler& stopHandlingEventsFor(IWindow* window)
virtual IEventResult defaultProcedure(IEvent& event)
virtual bool dispatchHandlerEvent(IEvent& event) = 0