Windows 7 automatically transitions open applications to match the default audio device so you don’t have to restart your programs to make the change take effect…which is why you’re having this problem. but you already figured that out probably.
I’d suggest your headphone’s output default so all games use it by default. Then you go into your music player’s audio output and change it to be your speaker’s output in the program preferences. I’ve done this with onboard (motherboard) sound and a sound card with VLC media player. Unfortunately I’ve never done it for any other programs but it’s typically an advanced setting/preference, google should help if you query “change audio output for for XYZ”.
The reason you’re setting the headphones to default is because game’s audio options for changing outputs will probably be more limited than music programs. And if you play many games you’ll have to change each game versus just one music program.
Virtual Audio Cable (30$) allows you to transfer audio (wave) streams between applications and/or devices.
It creates a set of virtual audio devices named “Virtual Cables”, each of them consists of a pair of the waveform input/output devices. Any application can send audio stream to an output side of a cable, and any other application can receive this stream from an input side. All transfers are made digitally, providing NO sound quality loss (a bitperfect streaming).
(foobar2000 have native global hotkey and output device choice :p)
For Zuneware there is an application someone wrote called ZuneKeys. I’ve never used it, so your mileage may vary.
If you use mplayer then you can select the audio device using the
mplayer -ao dsound:device=2 anymedia.mp3 command line switch – in my case this would play on the headphones as opposed to internal speakers.
In Windows Media Player you can set the default device in Options->Devices->Speakers->Properties but it did not work for me.