caesay
caesay

Reputation: 17213

How to detect when an audio device has been unplugged (windows vista) in C#

Id like to know how to detect when a device has been plugged in, and unplugged, and then mute / unmute the laptops internal speakers

Upvotes: 6

Views: 679

Answers (1)

John Knoeller
John Knoeller

Reputation: 34128

In unmanaged code you would listen for WM_DEVICECHANGE in your top level windowproc.

That appears to be the only way to do it in managed code as well.

Upvotes: 4

Related Questions