I want my Windows 7 machine to autmatically un-mute when I plug in headphones, and then return to mute when i unplug them.
If you make separate settings for headphone volume and speaker volume, you can set the speakers to zero volume. That would effectively give you mute when headphones are not plugged in.
This capability is dependent on your hardware and sound card drivers. Here's a useful post on this subject from a Windows 7 forum. You'll need to explore your sound card configuration to see if it's possible.