Is it possible to get automatically notified whenever the user connects or disconnects an audio device?
In Vista+ you can use Core Audio IMMNotificationClient interface to be notified.
The IMMNotificationClient interface provides notifications when an audio endpoint device is added or removed, when the state or properties of an endpoint device change, or when there is a change in the default role assigned to an endpoint device.
Handling WM_DEVICECHANGE
and/or polling is the solution in odler OS versions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With