/
githubmirror
/
PowerToys
Обзор
Документация
Войти
/
githubmirror
/
PowerToys
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/modules/cmdpal/ext/ProcessMonitorExtension/SwitchToProcess.cs
30 строк
933 B
Mike Griese
Rename the `[Ee]xts` dir to `ext` (#38852)
15 апр 2025, 14:07
Не верифицирован
15 апр 2025, 14:07
2b5181b
Код
Авторство
О чём код?
// 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; using System.Runtime.InteropServices; using Microsoft.CommandPalette.Extensions.Toolkit; namespace ProcessMonitorExtension; internal sealed partial class SwitchToProcess : InvokableCommand { [DllImport("user32.dll")] public static extern void SwitchToThisWindow(IntPtr hWnd, bool fAltTab); private readonly ProcessItem process; public SwitchToProcess(ProcessItem process) { this.process = process; this.Icon = new IconInfo(process.ExePath == string.Empty ? "\uE7B8" : process.ExePath); this.Name = "Switch to"; } public override CommandResult Invoke() { SwitchToThisWindow(process.Process.MainWindowHandle, true); return CommandResult.KeepOpen(); } }