Is there any universal way to detect speakers/headphones switching when e.g. user plugs headphones jack into computer? I’ve found that for some Realtek drivers:
- we can listen for some property change by implementing IMMNotificationClient.
- we can check MMDevice property in the registry, e.g.
- we can investigate
IKsJackDescription2configuration, but I’m not sure if there is any way of getting notified for changes.
All of this can work on one computer and it doesn’t work on others. Any ideas for more or less generic solution?