Skip to content
Draft
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
77a8555
push
noraa-junker Nov 16, 2025
6fea4d9
Fix tray icon behaviour
noraa-junker Nov 16, 2025
2ddf561
More things implemented
noraa-junker Nov 18, 2025
d1564b0
Adapt Always on Top module to use right settings and GPO
noraa-junker Nov 19, 2025
6dd9617
Adapt Always on Top module to use right settings and GPO
noraa-junker Nov 19, 2025
6d1f533
merge
noraa-junker Nov 19, 2025
18c3353
Change location of moduleinterfaces and fix hotkey issues
noraa-junker Nov 19, 2025
b9c9ade
Use atom variable in hotkey id
noraa-junker Nov 19, 2025
17af826
Include update ability
noraa-junker Nov 26, 2025
9afa3a1
Add Keyboard Hook mechanism
noraa-junker Dec 1, 2025
1532dd5
Move AlwaysOnTop to keyboard hook (like old moduleinterface)
noraa-junker Dec 1, 2025
231f59c
Remove old Advanced Paste module interface
noraa-junker Dec 1, 2025
43e9959
Fix ctrl alt key in Keyboard Hook and Advanced Paste custom actions
noraa-junker Dec 2, 2025
0155bb3
Port Awake
noraa-junker Dec 2, 2025
b971d87
Removed dependency on PowerToysSettings by moving HotkeySettingsContr…
noraa-junker Dec 3, 2025
261381f
Migrate Command on Palette module
noraa-junker Dec 3, 2025
bf99a2a
Migrate ColorPicker and use common process killer function
noraa-junker Dec 3, 2025
9cd2366
Port Command Palette module interface
noraa-junker Dec 10, 2025
09a79ab
Port Crop and Lock
noraa-junker Dec 10, 2025
123d318
Created a new way to treat process creation from module interfaces
noraa-junker Dec 11, 2025
5398c16
Add some documentation
noraa-junker Dec 11, 2025
99523fe
Moved from custom event implementation to EventWaitHanlde
noraa-junker Dec 14, 2025
79515f0
merge main
noraa-junker Dec 18, 2025
9b36bb9
Fix merging
noraa-junker Dec 18, 2025
f7a3021
Port Environment Variables module and fix launching hosts
noraa-junker Dec 18, 2025
2752054
Port Registry Preview and move module interface interface to models
noraa-junker Dec 19, 2025
e9cf911
Port File Explorer Add-Ons
noraa-junker Dec 21, 2025
4fe880c
Port ZoomIt
noraa-junker Dec 21, 2025
b3a084d
Port ZoomIt
noraa-junker Dec 21, 2025
c21ab5b
Merge branch 'feature/runner-v2' of https://github.com/microsoft/Powe…
noraa-junker Dec 21, 2025
5368c82
Port TextExtractor
noraa-junker Dec 21, 2025
a1c34b1
Port Screen Ruler
noraa-junker Dec 21, 2025
b1935ca
Merge main
noraa-junker Dec 21, 2025
9a77b8e
Remove project template
noraa-junker Dec 21, 2025
180d4a2
Port MouseJump
noraa-junker Dec 21, 2025
ec9071b
Fix File Explorer add-ons
noraa-junker Dec 21, 2025
1ad1c98
Port FancyZones
noraa-junker Dec 21, 2025
81494b2
Port PowerToys Run
noraa-junker Dec 21, 2025
f932679
Port Keyboard Manager
noraa-junker Dec 21, 2025
2350037
Port LightSwitch
noraa-junker Dec 22, 2025
14d8c36
Port LightSwitch
noraa-junker Dec 22, 2025
6b8a206
Merge branch 'feature/runner-v2' of https://github.com/microsoft/Powe…
noraa-junker Dec 22, 2025
25badc4
Fix some stuff
noraa-junker Dec 22, 2025
3c08019
Some build fixes
noraa-junker Dec 22, 2025
d0b46a9
Port ActionRunner
noraa-junker Jan 10, 2026
3ee8a78
Consolidate File Explorer cpp projects in one common project
noraa-junker Jan 10, 2026
ce24d9d
Port cursorwrap
noraa-junker Jan 11, 2026
6e882b9
Port Find My Mouse
noraa-junker Jan 11, 2026
57957d5
Merge main
noraa-junker Jan 11, 2026
5440699
Merge main
noraa-junker Jan 11, 2026
aede049
merge main
noraa-junker Jan 11, 2026
3f6b41f
Fix some merge errors and port workspaces
noraa-junker Jan 11, 2026
94ea759
Remove Hotkey functionality
noraa-junker Jan 11, 2026
a7ea407
Remove several now unused classes/projects
noraa-junker Jan 14, 2026
3006cbf
Fix version.h
noraa-junker Jan 14, 2026
7c870d4
Fix version.h
noraa-junker Jan 14, 2026
a2e81db
Merge branch 'feature/runner-v2' of https://github.com/microsoft/Powe…
noraa-junker Jan 14, 2026
8727a72
Signing
noraa-junker Jan 14, 2026
7df1c2f
merge main
noraa-junker Jan 21, 2026
297c7f0
Port Mouse Pointer Crosshairs
noraa-junker Jan 21, 2026
797bd4c
Port Mouse Highlighter and abstract IPowerToys module into other inte…
noraa-junker Jan 22, 2026
182e521
Delete outdated LightSwitch tests
noraa-junker Feb 2, 2026
e0868b0
Port MWB
noraa-junker Feb 2, 2026
0052971
Adapt new QuickAccess system and port FileExplorerDllExporter to VS2026
noraa-junker Feb 2, 2026
5a3ccb3
Adapt chromatic icon functionality
noraa-junker Feb 2, 2026
8bacded
Implement hiding the icon
noraa-junker Feb 2, 2026
36907ad
Fix tray icon name
noraa-junker Feb 3, 2026
315824f
Implement singleton and launching settings via exe
noraa-junker Feb 3, 2026
fb17678
Implement data diagnosticd GPO
noraa-junker Feb 3, 2026
39869bc
Implement full logging support
noraa-junker Feb 3, 2026
b27e108
Move icons to assets folder, ignore errors in IPC messaging system an…
noraa-junker Feb 3, 2026
9311ac2
Port New+ and port package.h fully to PowerToys.interop
noraa-junker Feb 3, 2026
139815c
Port PowerRename
noraa-junker Feb 3, 2026
cf0a0d7
Port ImageResizer
noraa-junker Feb 3, 2026
d55fc53
Port File Locksmith
noraa-junker Feb 3, 2026
c2fe908
Delete old ModuleInterface
noraa-junker Feb 3, 2026
29587e4
Port ShortcutGuide
noraa-junker Feb 3, 2026
54801f0
Port Peek
noraa-junker Feb 3, 2026
032e3d5
Make paste as plain text functional
noraa-junker Feb 3, 2026
16937cf
merge main
noraa-junker Feb 3, 2026
0c4b30e
Port PowerDisplay
noraa-junker Feb 3, 2026
33ce801
add parameter for powerdisplay profile apply and fix PowerDisplay
noraa-junker Feb 4, 2026
f903dcc
Add missing quick access option in context menu
noraa-junker Feb 11, 2026
cbf4851
Port Shortcut Conflicts
noraa-junker Feb 11, 2026
02f7a96
Implement toggling modules via dashboard and quick access panel
noraa-junker Feb 11, 2026
b1bfa4b
Implement change language
noraa-junker Feb 11, 2026
7e7a9d2
Implement restart as non elevated and get last updated state
noraa-junker Feb 12, 2026
e2b8790
Implement auto start
noraa-junker Feb 12, 2026
c6e7dfd
Implement AI detection
noraa-junker Feb 12, 2026
fc1195d
Move runnerv2 to appropriate location and remove old runner
noraa-junker Feb 12, 2026
b9755dc
Add notification support
noraa-junker Feb 12, 2026
07dee36
Merge remote-tracking branch 'origin/main' into feature/runner-v2
noraa-junker Feb 12, 2026
f732cdf
Merge branch 'main' into feature/shortcutguidev2
noraa-junker Feb 12, 2026
de03ce4
Fix merge and build errors
noraa-junker Feb 13, 2026
5f941ca
Fix some build errors
noraa-junker Feb 13, 2026
b1f950b
repair some more build errors
noraa-junker Feb 13, 2026
69d07e3
Fix test error from merge error
noraa-junker Feb 13, 2026
25847a3
Fix project file of ActionRunner
noraa-junker Feb 16, 2026
3d1a7e1
Some changes for the pipeline
noraa-junker Feb 16, 2026
40e9bbd
Fix installer (maybe?)
noraa-junker Feb 16, 2026
828c47c
Update PowerToys update project file
noraa-junker Feb 16, 2026
8f9cf7c
Update PowerToys update project file
noraa-junker Feb 16, 2026
e499395
Merge branch 'feature/runner-v2' of https://github.com/microsoft/Powe…
noraa-junker Feb 16, 2026
8fcba2d
Fix update project and add localisation
noraa-junker Feb 16, 2026
88dd87f
Fix installer now?
noraa-junker Feb 17, 2026
03017e4
Fix installer build
noraa-junker Feb 19, 2026
989c2ea
Fix some bugs and add debug menu
noraa-junker Feb 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 23 additions & 35 deletions PowerToys.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32014.148
# Visual Studio Version 18
VisualStudioVersion = 18.3.11206.111
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "runner", "src\runner\runner.vcxproj", "{9412D5C6-2CF2-4FC2-A601-B55508EA9B27}"
ProjectSection(ProjectDependencies) = postProject
Expand Down Expand Up @@ -374,8 +374,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AlwaysOnTop", "AlwaysOnTop"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AlwaysOnTop", "src\modules\alwaysontop\AlwaysOnTop\AlwaysOnTop.vcxproj", "{1DC3BE92-CE89-43FB-8110-9C043A2FE7A2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AlwaysOnTopModuleInterface", "src\modules\alwaysontop\AlwaysOnTopModuleInterface\AlwaysOnTopModuleInterface.vcxproj", "{48A0A19E-A0BE-4256-ACF8-CC3B80291AF9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Community.PowerToys.Run.Plugin.WebSearch", "src\modules\launcher\Plugins\Community.PowerToys.Run.Plugin.WebSearch\Community.PowerToys.Run.Plugin.WebSearch.csproj", "{9F94B303-5E21-4364-9362-64426F8DB932}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MousePointerCrosshairs", "src\modules\MouseUtils\MousePointerCrosshairs\MousePointerCrosshairs.vcxproj", "{EAE14C0E-7A6B-45DA-9080-A7D8C077BA6E}"
Expand Down Expand Up @@ -406,8 +404,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ImageResizerLib", "src\modu
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PowerAccent", "PowerAccent", "{0F14491C-6369-4C45-AAA8-135814E66E6B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PowerAccentModuleInterface", "src\modules\poweraccent\PowerAccentModuleInterface\PowerAccentModuleInterface.vcxproj", "{34A354C5-23C7-4343-916C-C52DAF4FC39D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerAccent.Core", "src\modules\poweraccent\PowerAccent.Core\PowerAccent.Core.csproj", "{3264DF53-C805-4B0C-867C-FCEAF7AEF762}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerAccent.UI", "src\modules\poweraccent\PowerAccent.UI\PowerAccent.UI.csproj", "{31CAD28E-778A-441C-85BC-40AB3EAA2A10}"
Expand Down Expand Up @@ -443,8 +439,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Hosts", "Hosts", "{F05E590D
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HostsEditor.UnitTests", "src\modules\Hosts\Hosts.Tests\HostsEditor.UnitTests.csproj", "{E2D03E0F-7A75-4813-9F4B-D8763D43FD3A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HostsModuleInterface", "src\modules\Hosts\HostsModuleInterface\HostsModuleInterface.vcxproj", "{B41B888C-7DB8-4747-B262-4062E05A230D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FileLocksmith", "FileLocksmith", "{AB82E5DD-C32D-4F28-9746-2C780846188E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FileLocksmithExt", "src\modules\FileLocksmith\FileLocksmithExt\FileLocksmithExt.vcxproj", "{57175EC7-92A5-4C1E-8244-E3FBCA2A81DE}"
Expand Down Expand Up @@ -834,6 +828,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LanguageModelProvider", "sr
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.CmdPal.UI.ViewModels.UnitTests", "src\modules\cmdpal\Tests\Microsoft.CmdPal.UI.ViewModels.UnitTests\Microsoft.CmdPal.UI.ViewModels.UnitTests.csproj", "{A66E9270-5D93-EC9C-F06E-CE7295BB9A6C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RunnerV2", "src\RunnerV2\RunnerV2\RunnerV2.csproj", "{20C43796-E14D-47B2-843A-843CAC9C0D28}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AlwaysOnTopModuleInterface", "src\modules\alwaysontop\AlwaysOnTopModuleInterface\AlwaysOnTopModuleInterface.csproj", "{2CF11A08-1A1F-4F75-BC41-F982FCF26D2F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM64 = Debug|ARM64
Expand Down Expand Up @@ -1610,14 +1608,6 @@ Global
{1DC3BE92-CE89-43FB-8110-9C043A2FE7A2}.Release|ARM64.Build.0 = Release|ARM64
{1DC3BE92-CE89-43FB-8110-9C043A2FE7A2}.Release|x64.ActiveCfg = Release|x64
{1DC3BE92-CE89-43FB-8110-9C043A2FE7A2}.Release|x64.Build.0 = Release|x64
{48A0A19E-A0BE-4256-ACF8-CC3B80291AF9}.Debug|ARM64.ActiveCfg = Debug|ARM64
{48A0A19E-A0BE-4256-ACF8-CC3B80291AF9}.Debug|ARM64.Build.0 = Debug|ARM64
{48A0A19E-A0BE-4256-ACF8-CC3B80291AF9}.Debug|x64.ActiveCfg = Debug|x64
{48A0A19E-A0BE-4256-ACF8-CC3B80291AF9}.Debug|x64.Build.0 = Debug|x64
{48A0A19E-A0BE-4256-ACF8-CC3B80291AF9}.Release|ARM64.ActiveCfg = Release|ARM64
{48A0A19E-A0BE-4256-ACF8-CC3B80291AF9}.Release|ARM64.Build.0 = Release|ARM64
{48A0A19E-A0BE-4256-ACF8-CC3B80291AF9}.Release|x64.ActiveCfg = Release|x64
{48A0A19E-A0BE-4256-ACF8-CC3B80291AF9}.Release|x64.Build.0 = Release|x64
{9F94B303-5E21-4364-9362-64426F8DB932}.Debug|ARM64.ActiveCfg = Debug|ARM64
{9F94B303-5E21-4364-9362-64426F8DB932}.Debug|ARM64.Build.0 = Debug|ARM64
{9F94B303-5E21-4364-9362-64426F8DB932}.Debug|x64.ActiveCfg = Debug|x64
Expand Down Expand Up @@ -1730,14 +1720,6 @@ Global
{18B3DB45-4FFE-4D01-97D6-5223FEEE1853}.Release|ARM64.Build.0 = Release|ARM64
{18B3DB45-4FFE-4D01-97D6-5223FEEE1853}.Release|x64.ActiveCfg = Release|x64
{18B3DB45-4FFE-4D01-97D6-5223FEEE1853}.Release|x64.Build.0 = Release|x64
{34A354C5-23C7-4343-916C-C52DAF4FC39D}.Debug|ARM64.ActiveCfg = Debug|ARM64
{34A354C5-23C7-4343-916C-C52DAF4FC39D}.Debug|ARM64.Build.0 = Debug|ARM64
{34A354C5-23C7-4343-916C-C52DAF4FC39D}.Debug|x64.ActiveCfg = Debug|x64
{34A354C5-23C7-4343-916C-C52DAF4FC39D}.Debug|x64.Build.0 = Debug|x64
{34A354C5-23C7-4343-916C-C52DAF4FC39D}.Release|ARM64.ActiveCfg = Release|ARM64
{34A354C5-23C7-4343-916C-C52DAF4FC39D}.Release|ARM64.Build.0 = Release|ARM64
{34A354C5-23C7-4343-916C-C52DAF4FC39D}.Release|x64.ActiveCfg = Release|x64
{34A354C5-23C7-4343-916C-C52DAF4FC39D}.Release|x64.Build.0 = Release|x64
{3264DF53-C805-4B0C-867C-FCEAF7AEF762}.Debug|ARM64.ActiveCfg = Debug|ARM64
{3264DF53-C805-4B0C-867C-FCEAF7AEF762}.Debug|ARM64.Build.0 = Debug|ARM64
{3264DF53-C805-4B0C-867C-FCEAF7AEF762}.Debug|x64.ActiveCfg = Debug|x64
Expand Down Expand Up @@ -1826,14 +1808,6 @@ Global
{E2D03E0F-7A75-4813-9F4B-D8763D43FD3A}.Release|ARM64.Build.0 = Release|ARM64
{E2D03E0F-7A75-4813-9F4B-D8763D43FD3A}.Release|x64.ActiveCfg = Release|x64
{E2D03E0F-7A75-4813-9F4B-D8763D43FD3A}.Release|x64.Build.0 = Release|x64
{B41B888C-7DB8-4747-B262-4062E05A230D}.Debug|ARM64.ActiveCfg = Debug|ARM64
{B41B888C-7DB8-4747-B262-4062E05A230D}.Debug|ARM64.Build.0 = Debug|ARM64
{B41B888C-7DB8-4747-B262-4062E05A230D}.Debug|x64.ActiveCfg = Debug|x64
{B41B888C-7DB8-4747-B262-4062E05A230D}.Debug|x64.Build.0 = Debug|x64
{B41B888C-7DB8-4747-B262-4062E05A230D}.Release|ARM64.ActiveCfg = Release|ARM64
{B41B888C-7DB8-4747-B262-4062E05A230D}.Release|ARM64.Build.0 = Release|ARM64
{B41B888C-7DB8-4747-B262-4062E05A230D}.Release|x64.ActiveCfg = Release|x64
{B41B888C-7DB8-4747-B262-4062E05A230D}.Release|x64.Build.0 = Release|x64
{57175EC7-92A5-4C1E-8244-E3FBCA2A81DE}.Debug|ARM64.ActiveCfg = Debug|ARM64
{57175EC7-92A5-4C1E-8244-E3FBCA2A81DE}.Debug|ARM64.Build.0 = Debug|ARM64
{57175EC7-92A5-4C1E-8244-E3FBCA2A81DE}.Debug|x64.ActiveCfg = Debug|x64
Expand Down Expand Up @@ -3036,6 +3010,22 @@ Global
{A66E9270-5D93-EC9C-F06E-CE7295BB9A6C}.Release|ARM64.Build.0 = Release|ARM64
{A66E9270-5D93-EC9C-F06E-CE7295BB9A6C}.Release|x64.ActiveCfg = Release|x64
{A66E9270-5D93-EC9C-F06E-CE7295BB9A6C}.Release|x64.Build.0 = Release|x64
{20C43796-E14D-47B2-843A-843CAC9C0D28}.Debug|ARM64.ActiveCfg = Debug|ARM64
{20C43796-E14D-47B2-843A-843CAC9C0D28}.Debug|ARM64.Build.0 = Debug|ARM64
{20C43796-E14D-47B2-843A-843CAC9C0D28}.Debug|x64.ActiveCfg = Debug|x64
{20C43796-E14D-47B2-843A-843CAC9C0D28}.Debug|x64.Build.0 = Debug|x64
{20C43796-E14D-47B2-843A-843CAC9C0D28}.Release|ARM64.ActiveCfg = Release|ARM64
{20C43796-E14D-47B2-843A-843CAC9C0D28}.Release|ARM64.Build.0 = Release|ARM64
{20C43796-E14D-47B2-843A-843CAC9C0D28}.Release|x64.ActiveCfg = Release|x64
{20C43796-E14D-47B2-843A-843CAC9C0D28}.Release|x64.Build.0 = Release|x64
{2CF11A08-1A1F-4F75-BC41-F982FCF26D2F}.Debug|ARM64.ActiveCfg = Debug|ARM64
{2CF11A08-1A1F-4F75-BC41-F982FCF26D2F}.Debug|ARM64.Build.0 = Debug|ARM64
{2CF11A08-1A1F-4F75-BC41-F982FCF26D2F}.Debug|x64.ActiveCfg = Debug|x64
{2CF11A08-1A1F-4F75-BC41-F982FCF26D2F}.Debug|x64.Build.0 = Debug|x64
{2CF11A08-1A1F-4F75-BC41-F982FCF26D2F}.Release|ARM64.ActiveCfg = Release|ARM64
{2CF11A08-1A1F-4F75-BC41-F982FCF26D2F}.Release|ARM64.Build.0 = Release|ARM64
{2CF11A08-1A1F-4F75-BC41-F982FCF26D2F}.Release|x64.ActiveCfg = Release|x64
{2CF11A08-1A1F-4F75-BC41-F982FCF26D2F}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -3150,7 +3140,6 @@ Global
{FCF3E52D-B80A-4FC3-98FD-6391354F0EE3} = {6B01F1CF-F4DB-48B5-BFE7-0BF576C1D704}
{60CD2D4F-C3B9-4897-9821-FCA5098B41CE} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC}
{1DC3BE92-CE89-43FB-8110-9C043A2FE7A2} = {60CD2D4F-C3B9-4897-9821-FCA5098B41CE}
{48A0A19E-A0BE-4256-ACF8-CC3B80291AF9} = {60CD2D4F-C3B9-4897-9821-FCA5098B41CE}
{9F94B303-5E21-4364-9362-64426F8DB932} = {4AFC9975-2456-4C70-94A4-84073C1CED93}
{EAE14C0E-7A6B-45DA-9080-A7D8C077BA6E} = {322566EF-20DC-43A6-B9F8-616AF942579A}
{F7C8C0F1-5431-4347-89D0-8E5354F93CF2} = {2F305555-C296-497E-AC20-5FA1B237996A}
Expand All @@ -3166,7 +3155,6 @@ Global
{93B72A06-C8BD-484F-A6F7-C9F280B150BF} = {6C7F47CC-2151-44A3-A546-41C70025132C}
{18B3DB45-4FFE-4D01-97D6-5223FEEE1853} = {6C7F47CC-2151-44A3-A546-41C70025132C}
{0F14491C-6369-4C45-AAA8-135814E66E6B} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC}
{34A354C5-23C7-4343-916C-C52DAF4FC39D} = {0F14491C-6369-4C45-AAA8-135814E66E6B}
{3264DF53-C805-4B0C-867C-FCEAF7AEF762} = {0F14491C-6369-4C45-AAA8-135814E66E6B}
{31CAD28E-778A-441C-85BC-40AB3EAA2A10} = {0F14491C-6369-4C45-AAA8-135814E66E6B}
{A50C70A6-2DA0-4027-B90E-B1A40755A8A5} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC}
Expand All @@ -3182,7 +3170,6 @@ Global
{31D1C81D-765F-4446-AA62-E743F6325049} = {F05E590D-AD46-42BE-9C25-6A63ADD2E3EA}
{F05E590D-AD46-42BE-9C25-6A63ADD2E3EA} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC}
{E2D03E0F-7A75-4813-9F4B-D8763D43FD3A} = {1C48CD47-D610-463A-A53C-AF82DD6C47E7}
{B41B888C-7DB8-4747-B262-4062E05A230D} = {F05E590D-AD46-42BE-9C25-6A63ADD2E3EA}
{AB82E5DD-C32D-4F28-9746-2C780846188E} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC}
{57175EC7-92A5-4C1E-8244-E3FBCA2A81DE} = {AB82E5DD-C32D-4F28-9746-2C780846188E}
{E69B044A-2F8A-45AA-AD0B-256C59421807} = {AB82E5DD-C32D-4F28-9746-2C780846188E}
Expand Down Expand Up @@ -3367,6 +3354,7 @@ Global
{4E0FCF69-B06B-D272-76BF-ED3A559B4EDA} = {8EF25507-2575-4ADE-BF7E-D23376903AB8}
{45354F4F-1414-45CE-B600-51CD1209FD19} = {1AFB6476-670D-4E80-A464-657E01DFF482}
{A66E9270-5D93-EC9C-F06E-CE7295BB9A6C} = {8EF25507-2575-4ADE-BF7E-D23376903AB8}
{2CF11A08-1A1F-4F75-BC41-F982FCF26D2F} = {60CD2D4F-C3B9-4897-9821-FCA5098B41CE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C3A2F9D1-7930-4EF4-A6FC-7EE0A99821D0}
Expand Down
90 changes: 90 additions & 0 deletions src/RunnerV2/RunnerV2/Helpers/ElevationHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
// 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.Diagnostics;
using System.Runtime.InteropServices;
using static RunnerV2.NativeMethods;

namespace RunnerV2.Helpers
{
internal static partial class ElevationHelper
{
internal static RestartScheduledMode RestartScheduled { get; set; } = RestartScheduledMode.None;

internal enum RestartScheduledMode
{
None,
RestartElevated,
RestartElevatedWithOpenSettings,
RestartNonElevated,
}

private static bool? _cachedValue;

internal static void RestartIfScheudled()

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

Scheudled is not a recognized word. (unrecognized-spelling)
{
switch (RestartScheduled)
{
case RestartScheduledMode.None:
return;
case RestartScheduledMode.RestartElevated:
RestartAsAdministrator("--restartedElevated");
break;
case RestartScheduledMode.RestartElevatedWithOpenSettings:
RestartAsAdministrator("--restartedElevated --open-settings");
break;
case RestartScheduledMode.RestartNonElevated:
// Todo: restart unelevated
break;
}
}

private static void RestartAsAdministrator(string arguments)
{
ProcessStartInfo processStartInfo = new()
{
Arguments = arguments,
Verb = "runas",
UseShellExecute = true,
FileName = Environment.ProcessPath,
};

try
{
Process.Start(processStartInfo);
}
catch (Exception ex)
{
Console.WriteLine("Failed to restart as administrator: " + ex);
}
}

internal static bool IsProcessElevated(bool useCachedValue = true)
{
if (_cachedValue is not null && useCachedValue)
{
return _cachedValue.Value;
}

bool elevated = false;
if (OpenProcessToken(Process.GetCurrentProcess().Handle, TOKENQUERY, out nint token))

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

TOKENQUERY is not a recognized word. (unrecognized-spelling)
{
TokenElevation elevation = default;
if (GetTokenInformation(token, TOKEN_INFORMATION_CLASS.TOKEN_ELEVATION, ref elevation, (uint)Marshal.SizeOf(elevation), out uint _))
{
elevated = elevation.TokenIsElevated != 0;
}

if (token != IntPtr.Zero)
{
CloseHandle(token);
}
}

_cachedValue = elevated;
return elevated;
}
}
}
59 changes: 59 additions & 0 deletions src/RunnerV2/RunnerV2/Helpers/HotkeyManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// 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.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading;
using ManagedCommon;
using Microsoft.PowerToys.Settings.UI.Library;
using Windows.System;
using static RunnerV2.NativeMethods;

namespace RunnerV2.Helpers
{
internal static partial class HotkeyManager
{
private static readonly Dictionary<HotkeyEx, Action> _hotkeyActions = [];

[STAThread]
public static void EnableHotkey(HotkeyEx hotkey, Action onHotkey)
{
if (_hotkeyActions.ContainsKey(hotkey))
{
return;
}

_hotkeyActions[hotkey] = onHotkey;

if (!RegisterHotKey(Runner.RunnerHwnd, hotkey.GetHashCode(), hotkey.ModifiersMask, hotkey.VkCode))
{
Console.WriteLine("Failed to register hotkey: " + hotkey);
var lastError = Marshal.GetLastWin32Error();
Console.WriteLine("LastError: " + lastError);
}
}

public static void DisableHotkey(HotkeyEx hotkey)
{
if (!_hotkeyActions.ContainsKey(hotkey))
{
return;
}

_hotkeyActions.Remove(hotkey);
UnregisterHotKey(IntPtr.Zero, hotkey.GetHashCode());
}

public static void ProcessHotkey(nuint hotkeyId)
{
ulong hashId = hotkeyId.ToUInt64();
if (_hotkeyActions.Any(h => h.Key.GetHashCode() == (int)hashId))
{
_hotkeyActions.First(h => h.Key.GetHashCode() == (int)hashId).Value();
}
}
}
}
Loading
Loading