/
githubmirror
/
PowerToys
Обзор
Документация
Войти
/
githubmirror
/
PowerToys
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/modules/powerdisplay/PowerDisplay/Helpers/SettingsDeepLink.cs
37 строк
1 KB
moooyo
Introduce new utility PowerDisplay to control your monitor settings (#42642)
03 фев 2026, 08:53
Не верифицирован
03 фев 2026, 08:53
18efa05
Код
Авторство
О чём код?
// Copyright (c) Microsoft Corporation // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Diagnostics; using System.IO; namespace PowerDisplay.Helpers { public static class SettingsDeepLink { public static void OpenSettings(bool mainExecutableIsOnTheParentFolder) { try { var directoryPath = System.AppContext.BaseDirectory; if (mainExecutableIsOnTheParentFolder) { // Need to go into parent folder for PowerToys.exe. Likely a WinUI3 App SDK application. directoryPath = Path.Combine(directoryPath, ".."); directoryPath = Path.Combine(directoryPath, "PowerToys.exe"); } else { // PowerToys.exe is in the same path as the application. directoryPath = Path.Combine(directoryPath, "PowerToys.exe"); } Process.Start(new ProcessStartInfo(directoryPath) { Arguments = "--open-settings=PowerDisplay" }); } catch { // Silently ignore errors opening settings } } } }