【问题标题】:How to launch settings/defaultapp window programatically on Windows 8/8.1?如何在 Windows 8/8.1 上以编程方式启动设置/默认应用程序窗口?
【发布时间】:2019-11-03 11:09:34
【问题描述】:

对于 Windows 8/8.1,Launching Settings App programmatically on Windows 10 是否有任何替代方案?

我需要在 Windows 8/8.1 机器上启动 App Defaults 页面。在 Windows 10 上,我这样做:

bool result = await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings:privacy-webcam"));

我还没有找到适用于 Windows 8 的替代方案。有什么建议吗?

【问题讨论】:

  • 文档说 IApplicationActivationManager 受 Windows 8 支持(我无法测试)。在 Windows 10 上,要启动 App Defaults 页面,我使用 L"page=SettingsPageAppsDefaults" L"&target=SettingsPageAppsDefaultsDefaultAppsListView" 作为参数。

标签: windows winapi windows-8 windows-8.1


【解决方案1】:

在 Vista 到 8.1 上使用 canonical Control Panel item names

可以使用IOpenControlPanel::Open或者执行control.exe:

%systemroot%\system32\control.exe /name Microsoft.DefaultPrograms /page pageDefaultProgram

Windows XP 和更早版本仅限 supports a handful of items,它们使用旧样式名称。

Windows 8 上的“设置”应用可以通过这个 hack 启动:

Explorer.exe shell:AppsFolder\Windows.ImmersiveControlPanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel

但我不确定是否有办法打开特定页面。

【讨论】:

    猜你喜欢
    • 2012-10-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-13
    • 2011-03-27
    相关资源
    最近更新 更多