Search code examples
c#winformsdesktop-application.net-framework-version

C# Desktop Forms Framework to use Windows.System


I'm not using UWP, this is a standard Desktop App using .NET Framework. I'm looking to use the following, but this is only for UWP.

https://learn.microsoft.com/en-us/uwp/api/windows.system.launcher.launchuriasync?view=winrt-22621

[Windows.Foundation.Metadata.Overload("LaunchUriWithDataAsync")]
public static IAsyncOperation<bool> LaunchUriAsync(System.Uri uri, LauncherOptions options, ValueSet inputData);

When someone has their Microphone disabled or access turned off, I want to route them to the correct location to to be changed. Zoom does this today. enter image description here

The only place I found where I can do this is within UWP with Namespace: Windows.System.

Any ideas on how I can accomplish this task?


Solution

  • That just opens a URL. Specifically, it opens one of the ms-settings: locations. In Framework, you do it with Process.Start():

    System.Diagnostics.Process.Start("ms-settings:privacy-microphone")
    

    I'm not sure that's exactly the intended page, but it should be close enough for you to get what you need.