How to programmatically disable a playback in the sound control panel?

Victor Chen 106 Reputation points
2020-09-23T11:59:32.183+00:00

The original requirement was to switch the communication device in Skype for Business, but since there is no such api (please tell me if there is any way to do this), so I gave up. Then I found that by disable/enable the device, Skype for Business seems to be able to detect this action and prompt the user to switch the communication device.

I know to use devcon.exe in the WDK to disable/enable a device, but when the device is playing sound, disabling the device will be prompted to reboot the system, so this method does not work.

So is there any way to help me do this?

Windows development | Windows API - Win32
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 90,681 Reputation points
    2020-09-23T13:48:05.51+00:00

    If you're talking about this : https://i.ibb.co/mvrpKCQ/Deactivate-Device.jpg

    It is done with IPolicyConfig.SetEndpointVisibility

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. xiaoguo 0 Reputation points
    2024-05-14T08:44:24.4233333+00:00

    Can you provide a demo or a link to use IPolicyConfig.SetEndpointVisibility ? Bro

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.