I want to develop a C#/.NET application that detects when headphones are plugged in, and unplugged. I want to log these events to a file, so I can discover and note when someone steals headphones from one of the (100 or so) systems that I manage.
How can I detect when headphones are plugged in, and unplugged?