Hi,
Set default sound device has the following problems: Some applications don't respect the change while running (mainly games), so you have to restart them. A better solution is to deactivate all sound devices you don't want, this is always respected. I have written a script for this:
^+i:: Run, RunDll32.exe shell32.dll`,Control_RunDLL mmsys.cpl`,`,0 WinActivate, Sound WinWaitActive, Sound, , 2 Sleep, 100 ControlClick, x50 y120, Sound,,RIGHT Sleep, 100 Send {DOWN 3}{ENTER} Sleep, 100 WinClose, Sound
The problem is, that a have to go to Desktop with Alt+Tab to work (could be integrated) but not all games accept Alt+Tab. So I am looking for a way to deactivate a sound device with a command. devcon doesn't work, it needs a reboot. The API you have discovered looks promising, but I have no clue about it. Especially http://msdn.microsof...9(v=vs.85).aspx