I posted this on MSDN Forums » Audio and Video Development » Media Foundation Development before I found this forum. I think this is a better place. For some reasons I could not delete it there, so please don´t blame me for double-posting :) In the Vista sound-control-panel one can activate and deactivate what is now called sound devices (microphon, line-in, phone etc.) Is there a was to do this via code?
First of all I did not manage it to get the deactivated devices by the EnumAudioEndpoints Method using the predefined flags. On my system the device state in the registry is 0x10000001, in case of a device not beeing active. I defined a custom flag with this value and the EnumAudioEndpoints method succesfully returned the deactivated devices.
Is there a way to activate this devices? I tried to edit the registry entries via code, but got UnauthorizedAccess Exeptions. Using regedit works. The device object provides a GetState but unfortunately not a SetState method.