1 #pragma once 2 #include <mmdeviceapi.h> 3 class CDevicesManager; 4 class CMMNotificationClient : public IMMNotificationClient 5 { 6 public: 7 CMMNotificationClient(IMMDeviceEnumerator* _pEnum, CDevicesManager* manager); 8 virtual ~CMMNotificationClient(); 9 ULONG STDMETHODCALLTYPE AddRef(); 10 ULONG STDMETHODCALLTYPE Release(); 11 HRESULT STDMETHODCALLTYPE QueryInterface( 12 REFIID riid, VOID** ppvInterface); 13 HRESULT STDMETHODCALLTYPE OnDefaultDeviceChanged( 14 EDataFlow flow, ERole role, 15 LPCWSTR pwstrDeviceId); 16 HRESULT STDMETHODCALLTYPE OnDeviceAdded(LPCWSTR pwstrDeviceId); 17 HRESULT STDMETHODCALLTYPE OnDeviceRemoved(LPCWSTR pwstrDeviceId); 18 HRESULT STDMETHODCALLTYPE OnDeviceStateChanged( 19 LPCWSTR pwstrDeviceId, 20 DWORD dwNewState); 21 HRESULT STDMETHODCALLTYPE OnPropertyValueChanged( 22 LPCWSTR pwstrDeviceId, 23 const PROPERTYKEY key); 24 private: 25 LONG _cRef; 26 IMMDeviceEnumerator* _pEnum; 27 CDevicesManager* manager; 28 }; 29 30