mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-01-09 13:57:05 +01:00
Compare commits
230 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd5af79237 | ||
|
|
75e966ce19 | ||
|
|
a09d8bf14b | ||
|
|
d5a5f858c0 | ||
|
|
2cf354ff28 | ||
|
|
3ea0a10c73 | ||
|
|
6f50a38e5f | ||
|
|
1fc7a59b7c | ||
|
|
c7e0850b7b | ||
|
|
fd01ee391b | ||
|
|
44165621f0 | ||
|
|
686a48a29b | ||
|
|
e444881320 | ||
|
|
12282a8dc7 | ||
|
|
95dcbb1891 | ||
|
|
04588bc7e0 | ||
|
|
172c63f1e2 | ||
|
|
b5622cd07a | ||
|
|
ba73bc7d50 | ||
|
|
bdbf0b8c14 | ||
|
|
79227b9db6 | ||
|
|
4aadaf9bf1 | ||
|
|
403969587e | ||
|
|
1be880438a | ||
|
|
80e9fc0c43 | ||
|
|
559a0442d8 | ||
|
|
724620a24e | ||
|
|
75f2be1891 | ||
|
|
aba4e462a8 | ||
|
|
58aa274b21 | ||
|
|
d9c054b1f5 | ||
|
|
53a92215fc | ||
|
|
d7617a47d3 | ||
|
|
ada3a9ad88 | ||
|
|
c22a3fbcb7 | ||
|
|
9c9b5d9dca | ||
|
|
dd03d1ee63 | ||
|
|
ae196fd592 | ||
|
|
b3a0bf7919 | ||
|
|
58b219f671 | ||
|
|
889bc1e514 | ||
|
|
fcc1d46b63 | ||
|
|
1d15070698 | ||
|
|
380add882c | ||
|
|
4c067bb728 | ||
|
|
42ba008323 | ||
|
|
b7d528b6e8 | ||
|
|
176f2c2870 | ||
|
|
2e3a2b3f96 | ||
|
|
f4f8a1bd69 | ||
|
|
34e4e7e5bd | ||
|
|
5914fc1ffd | ||
|
|
bad435bb26 | ||
|
|
41f4d971dd | ||
|
|
79d4782b23 | ||
|
|
cfdaea4363 | ||
|
|
d66fac3c3c | ||
|
|
66619ca059 | ||
|
|
79b2cdca7b | ||
|
|
3e9c7f83c8 | ||
|
|
561882c2f1 | ||
|
|
7365ba14d0 | ||
|
|
bf3e427017 | ||
|
|
50169f9271 | ||
|
|
1f64c1cf83 | ||
|
|
6648402ddb | ||
|
|
0816714782 | ||
|
|
a8fb9e0804 | ||
|
|
309a0661c3 | ||
|
|
0d3aa3a187 | ||
|
|
94391775c8 | ||
|
|
b1b1f1ba21 | ||
|
|
ba525f068b | ||
|
|
ffdb5d44d7 | ||
|
|
3b04cfd267 | ||
|
|
462b48edae | ||
|
|
05d5649c9c | ||
|
|
b415e79ef5 | ||
|
|
477041a884 | ||
|
|
425346b1f2 | ||
|
|
46684966a1 | ||
|
|
eb961ee052 | ||
|
|
0a5bdf6734 | ||
|
|
ec3ea5c4ae | ||
|
|
9cf39654d9 | ||
|
|
139c6c2c8d | ||
|
|
b20e991a35 | ||
|
|
81f61630cb | ||
|
|
e8363a3be1 | ||
|
|
27611593bd | ||
|
|
6b6ba2205c | ||
|
|
aa2c9390ef | ||
|
|
45f121b8bc | ||
|
|
400cd7ea45 | ||
|
|
62c2f9479b | ||
|
|
3a8218be44 | ||
|
|
5881469855 | ||
|
|
4e662f61c3 | ||
|
|
efd14d8611 | ||
|
|
57bc924d8d | ||
|
|
3715b0c378 | ||
|
|
2783342f33 | ||
|
|
1920a1f3de | ||
|
|
29a25454d8 | ||
|
|
47920f50f3 | ||
|
|
cc8d8074bb | ||
|
|
b4250c1235 | ||
|
|
c428f0787d | ||
|
|
c3b378101c | ||
|
|
489335e4d0 | ||
|
|
ddc075d24c | ||
|
|
50a73965d9 | ||
|
|
d5fc4547a2 | ||
|
|
84e142631e | ||
|
|
8edfb8fe80 | ||
|
|
d9c98bbc29 | ||
|
|
4ff7e4150f | ||
|
|
f4044ffd51 | ||
|
|
2b747d02d3 | ||
|
|
6a722e2961 | ||
|
|
230c199ee5 | ||
|
|
87bb89ab15 | ||
|
|
e9dccf82ab | ||
|
|
4cc74602c1 | ||
|
|
6b2cde7eb0 | ||
|
|
af65d79573 | ||
|
|
dabf657761 | ||
|
|
4572f62ce5 | ||
|
|
f2093ec423 | ||
|
|
51aba915f0 | ||
|
|
9fff2b535f | ||
|
|
3ede2a6467 | ||
|
|
35bfb0f83e | ||
|
|
832f580aa8 | ||
|
|
03b7cb4690 | ||
|
|
d744ca33b6 | ||
|
|
05728a6dc2 | ||
|
|
10a5629fe8 | ||
|
|
38e401007a | ||
|
|
3508301f06 | ||
|
|
3df2c5fe6a | ||
|
|
dc15a6cecc | ||
|
|
f6a292d47f | ||
|
|
f0d084c59c | ||
|
|
9fc3727709 | ||
|
|
218e9cfcb9 | ||
|
|
9e029c0867 | ||
|
|
01a3106450 | ||
|
|
416419ffde | ||
|
|
57a8d505c0 | ||
|
|
ddcb065b22 | ||
|
|
8c64a0b6f8 | ||
|
|
cc68133ddc | ||
|
|
692817e382 | ||
|
|
651e823c30 | ||
|
|
11bb7ccf60 | ||
|
|
c3dda238e9 | ||
|
|
ff95257e5f | ||
|
|
e284b07da7 | ||
|
|
49a2218358 | ||
|
|
c46ccce373 | ||
|
|
2cdf6f9cc0 | ||
|
|
8bb0772ae5 | ||
|
|
2a34cf740b | ||
|
|
314425e32e | ||
|
|
26e3eb9350 | ||
|
|
a3dbb55404 | ||
|
|
f62dd6933c | ||
|
|
3e7b04891d | ||
|
|
ddf96e28b8 | ||
|
|
567cc50fb7 | ||
|
|
79c13aec6e | ||
|
|
26f01431ff | ||
|
|
55e3a94da3 | ||
|
|
0fc69ca222 | ||
|
|
51a43d58de | ||
|
|
b27a7261be | ||
|
|
8144f5cedd | ||
|
|
f67ae38aba | ||
|
|
6b5fd308cb | ||
|
|
fb4ab87fdd | ||
|
|
d302c761d7 | ||
|
|
814c8e382c | ||
|
|
b98be49bfa | ||
|
|
91d36b4b47 | ||
|
|
03c36b4f65 | ||
|
|
792a04cf48 | ||
|
|
a1bb281386 | ||
|
|
941ff0a5a6 | ||
|
|
39b98dab3b | ||
|
|
f9434ac812 | ||
|
|
022ed601ec | ||
|
|
e131d0ff4b | ||
|
|
f6f8e4c4eb | ||
|
|
5880f3855b | ||
|
|
1a25dacc73 | ||
|
|
b6a207c4b6 | ||
|
|
cccadec44c | ||
|
|
edc43e39ca | ||
|
|
5eaf60e8a2 | ||
|
|
2182aabe35 | ||
|
|
2ccf492707 | ||
|
|
0506f06a18 | ||
|
|
2e8dfa73d2 | ||
|
|
453bb613af | ||
|
|
7833ace553 | ||
|
|
6a01be2c38 | ||
|
|
ac4f725433 | ||
|
|
a1f319afa7 | ||
|
|
714ca349ff | ||
|
|
dec1aca97f | ||
|
|
409f58e55a | ||
|
|
f721c1f226 | ||
|
|
a1643b0a2e | ||
|
|
f6576e01f3 | ||
|
|
758a21a22f | ||
|
|
167ec5a3a8 | ||
|
|
8c24d7e942 | ||
|
|
5035dc6754 | ||
|
|
ba431c5bfd | ||
|
|
a96187bd04 | ||
|
|
127cf4e412 | ||
|
|
aa876838d4 | ||
|
|
1a9473c896 | ||
|
|
d52037fd5e | ||
|
|
bcba63e4b2 | ||
|
|
f303c29d4c | ||
|
|
cf0c45a319 | ||
|
|
67933a8470 | ||
|
|
a0dca4f401 |
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -13,3 +13,5 @@
|
||||
# entries below.
|
||||
###############################################################################
|
||||
*.rc diff
|
||||
|
||||
*.gcode linguist-detectable=false
|
||||
|
||||
7
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
7
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -12,7 +12,7 @@ body:
|
||||
attributes:
|
||||
label: Microsoft PowerToys version
|
||||
placeholder: |
|
||||
"0.33.1"
|
||||
"0.53.0"
|
||||
description: |
|
||||
Hover over system tray icon or look at Settings
|
||||
validations:
|
||||
@@ -32,8 +32,10 @@ body:
|
||||
multiple: true
|
||||
options:
|
||||
- General
|
||||
- Always on Top
|
||||
- Awake
|
||||
- ColorPicker
|
||||
- Developer file preview
|
||||
- FancyZones
|
||||
- FancyZones Editor
|
||||
- Image Resizer
|
||||
@@ -47,6 +49,7 @@ body:
|
||||
- PowerRename
|
||||
- PowerToys Run
|
||||
- Shortcut Guide
|
||||
- STL Thumbnail
|
||||
- SVG Preview
|
||||
- SVG Thumbnail
|
||||
- Settings
|
||||
@@ -77,7 +80,7 @@ body:
|
||||
label: ❌ Actual Behavior
|
||||
placeholder: What happened instead?
|
||||
validations:
|
||||
required: true
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
|
||||
11
.github/ISSUE_TEMPLATE/translation_issue.yml
vendored
11
.github/ISSUE_TEMPLATE/translation_issue.yml
vendored
@@ -13,7 +13,7 @@ body:
|
||||
- type: input
|
||||
attributes:
|
||||
label: Microsoft PowerToys version
|
||||
placeholder: "0.35.0"
|
||||
placeholder: "0.53.0"
|
||||
description: |
|
||||
Hover over system tray icon or look at Settings
|
||||
validations:
|
||||
@@ -23,20 +23,27 @@ body:
|
||||
label: Utility with translation issue
|
||||
options:
|
||||
- General
|
||||
- PowerToys Awake
|
||||
- Always on Top
|
||||
- Awake
|
||||
- ColorPicker
|
||||
- Developer file preview
|
||||
- FancyZones
|
||||
- FancyZones Editor
|
||||
- Image Resizer
|
||||
- Keyboard Manager
|
||||
- MD Preview
|
||||
- Mouse Utilities
|
||||
- PDF Preview
|
||||
- PDF Thumbnail
|
||||
- G-code Preview
|
||||
- G-code Thumbnail
|
||||
- PowerRename
|
||||
- PowerToys Run
|
||||
- Shortcut Guide
|
||||
- SVG Preview
|
||||
- SVG Thumbnail
|
||||
- Settings
|
||||
- Video Conference Mute
|
||||
- Welcome / PowerToys Tour window
|
||||
- System tray interaction
|
||||
- Installer
|
||||
|
||||
11
.github/actions/spell-check/allow/names.txt
vendored
Normal file
11
.github/actions/spell-check/allow/names.txt
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
bdoserror
|
||||
crutkas
|
||||
edwinzap
|
||||
hallatore
|
||||
mshtang
|
||||
nVidia
|
||||
robmen
|
||||
skycommand
|
||||
snickler
|
||||
Vidia
|
||||
yifan
|
||||
12
.github/actions/spell-check/excludes.txt
vendored
12
.github/actions/spell-check/excludes.txt
vendored
@@ -1,4 +1,8 @@
|
||||
# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-excludes
|
||||
(?:^|/)monacoSRC/
|
||||
(?:^|/)MonacoPreviewHandler/monaco_languages.json
|
||||
(?:^|/)MonacoPreviewHandler/index.html
|
||||
(?:^|/)MonacoPreviewHandler/generateLanguagesJson.html
|
||||
(?:^|/)(?i)COPYRIGHT
|
||||
(?:^|/)(?i)LICEN[CS]E
|
||||
(?:^|/)package(?:-lock)\.json$
|
||||
@@ -26,9 +30,11 @@ ignore$
|
||||
\.pdf$
|
||||
\.PNG$
|
||||
\.png$
|
||||
\.stl$
|
||||
\.woff$
|
||||
\.zip$
|
||||
^doc/devdocs/akaLinks\.md$
|
||||
^installer/PowerToysSetup/WebView2/MicrosoftEdgeWebview2Setup.exe$
|
||||
^src/common/logger/logger\.vcxproj\.filters$
|
||||
^src/common/notifications/BackgroundActivatorDLL/BackgroundActivator\.vcxproj\.filters$
|
||||
^src/common/notifications/BackgroundActivatorDLL/cpp\.hint$
|
||||
@@ -37,11 +43,13 @@ ignore$
|
||||
^src/modules/imageresizer/dll/ContextMenuHandler\.rgs$
|
||||
^src/modules/imageresizer/dll/ImageResizerExt\.rgs$
|
||||
^src/modules/powerrename/testapp/PowerRenameTest\.vcxproj\.filters$
|
||||
^src/modules/powerrename/UWPui/pch\.h$
|
||||
^src/modules/powerrename/UWPui/PowerRenameUWPUI\.vcxproj\.filters$
|
||||
^src/modules/previewpane/PreviewPaneUnitTests/HelperFiles/MarkdownWithHTMLImageTag\.txt$
|
||||
^src/modules/previewpane/UnitTests-MarkdownPreviewHandler/HelperFiles/MarkdownWithHTMLImageTag.txt$
|
||||
^tools/CleanUp_tool/CleanUp_tool\.vcxproj\.filters$
|
||||
^tools/Verification scripts/Check preview handler registration\.ps1$
|
||||
^\.github/
|
||||
^\.github/actions/spell-check/
|
||||
^\.gitmodules$
|
||||
(?:^|/)WindowsSettings\.json$
|
||||
(?:^|/)timezones\.json$
|
||||
^\Q.pipelines/ESRPSigning_core.json\E$
|
||||
|
||||
270
.github/actions/spell-check/expect.txt
vendored
270
.github/actions/spell-check/expect.txt
vendored
File diff suppressed because it is too large
Load Diff
26
.github/actions/spell-check/patterns.txt
vendored
26
.github/actions/spell-check/patterns.txt
vendored
@@ -12,6 +12,10 @@ https?://(?:(?:www\.|)youtube\.com|youtu.be)/[-a-zA-Z0-9?&=]*
|
||||
# msdn
|
||||
\b(?:download\.visualstudio|docs|msdn)\.microsoft\.com/[-_a-zA-Z0-9()=./]*
|
||||
|
||||
# medium
|
||||
link\.medium\.com/[a-zA-Z0-9]+
|
||||
\bmedium\.com/\@[^/]+/[-\w]+
|
||||
|
||||
publicKeyToken=(['"]|)[0-9a-f]+\g{-1}
|
||||
\@sha256:[0-9a-f]{64}\b
|
||||
|
||||
@@ -19,15 +23,21 @@ publicKeyToken=(['"]|)[0-9a-f]+\g{-1}
|
||||
(['"])data:.*?\g{-1}
|
||||
data:[-a-zA-Z=;:/0-9+]*,\S*
|
||||
|
||||
# uuid:
|
||||
L?(["']|[-<({>]|\b)[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}(?:\g{-1}|[<})>])
|
||||
# uuid: (or CompGUIDPrefix)
|
||||
L?(["']|[-<({>]|\b)[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{10,12}(?:\g{-1}|[<})>])
|
||||
|
||||
# c99 hex digits (not the full format, just one I've seen)
|
||||
0x[0-9a-fA-F](?:\.[0-9a-fA-F]*|)[pP]
|
||||
|
||||
# URL escaped characters
|
||||
\%[0-9A-F]{2}
|
||||
|
||||
# wregex
|
||||
std::wregex\(L"[^"]*"\)
|
||||
|
||||
# hash
|
||||
Hash="[0-9A-F]{40}"
|
||||
|
||||
# hex digits including css/html color classes:
|
||||
(?:[\\0][xX]|\\u|[uU]\+|#x?|\%23|L")[0-9a-fA-FgGrR_]{2,}(?:[uU]?[lL]{0,2}|u\d+)\b
|
||||
|
||||
@@ -42,12 +52,18 @@ TestCase\("[^"]+"
|
||||
\[DataRow\("[0-9A-F]{6}", \d{3}.\d{1}, \d{3}.\d{1}, \d{3}.\d{1}\)\]
|
||||
\[DataRow\("[0-9A-F]{6}", "[BCGMRY]\d\d?", \d{3}, \d{3}\)\]
|
||||
|
||||
# version suffix <word>v#
|
||||
[Vv]\d+(?:\b|(?=[a-zA-Z_]))
|
||||
|
||||
# Windows paths
|
||||
\\native
|
||||
\\netcoreapp
|
||||
\\netstandard
|
||||
\\network
|
||||
\\notifications
|
||||
\\recyclebin
|
||||
\\Registry
|
||||
\\registry
|
||||
\\reinstall
|
||||
\\Resize
|
||||
\\resource
|
||||
@@ -75,8 +91,14 @@ TestCase\("[^"]+"
|
||||
# TestCase strings intentionally have non dictionary items
|
||||
\[TestCase\(new string.*\]
|
||||
|
||||
# D2D
|
||||
D2D
|
||||
|
||||
# marker for ignoring a comment to the end of the line
|
||||
^.*/\* #no-spell-check-line \*/.*$
|
||||
// #no-spell-check.*$
|
||||
|
||||
http://tes/
|
||||
|
||||
# tar arguments
|
||||
\b(?:\\n|)tar(?:\s+-[a-zA-Z]+|\s[a-z]+)+
|
||||
|
||||
1
.github/workflows/spelling2.yml
vendored
1
.github/workflows/spelling2.yml
vendored
@@ -72,5 +72,6 @@ jobs:
|
||||
- name: comment
|
||||
uses: check-spelling/check-spelling@v0.0.20-alpha3
|
||||
with:
|
||||
config: .github/actions/spell-check
|
||||
custom_task: comment
|
||||
internal_state_directory: /tmp/data
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -344,3 +344,6 @@ src/common/Telemetry/*.etl
|
||||
/src/modules/previewpane/SvgThumbnailProvider/$(SolutionDir)$(Platform)/$(Configuration)/modules/FileExplorerPreview/SvgThumbnailProvider.xml
|
||||
/src/modules/powerrename/ui/RCa24464
|
||||
/src/modules/powerrename/ui/RCb24464
|
||||
|
||||
# Generated installer file for Monaco source files.
|
||||
/installer/PowerToysSetup/MonacoSRC.wxs
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
"*.resources.dll",
|
||||
|
||||
"PowerToysSetupCustomActions.dll",
|
||||
|
||||
|
||||
"PowerToys.ActionRunner.exe",
|
||||
"PowerToys.Update.exe",
|
||||
@@ -16,14 +15,17 @@
|
||||
"os-detection.dll",
|
||||
"PowerToys.exe",
|
||||
"PowerToys.Interop.dll",
|
||||
"BugReportTool\\BugReportTool.exe",
|
||||
"WebcamReportTool\\WebcamReportTool.exe",
|
||||
"BugReportTool\\PowerToys.BugReportTool.exe",
|
||||
"WebcamReportTool\\PowerToys.WebcamReportTool.exe",
|
||||
"Telemetry.dll",
|
||||
"PowerToys.ManagedTelemetry.dll",
|
||||
"PowerToys.ManagedCommon.dll",
|
||||
"PowerToys.Common.UI.dll",
|
||||
"PowerToys.Settings.UI.Lib.dll",
|
||||
|
||||
"modules\\AlwaysOnTop\\PowerToys.AlwaysOnTop.exe",
|
||||
"modules\\AlwaysOnTop\\PowerToys.AlwaysOnTopModuleInterface.dll",
|
||||
|
||||
"modules\\ColorPicker\\ColorPicker.dll",
|
||||
"modules\\ColorPicker\\ColorPickerUI.dll",
|
||||
"modules\\ColorPicker\\ColorPickerUI.exe",
|
||||
@@ -32,9 +34,6 @@
|
||||
"modules\\ColorPicker\\PowerToys.ColorPickerUI.dll",
|
||||
"modules\\ColorPicker\\PowerToys.ColorPickerUI.exe",
|
||||
|
||||
"modules\\AlwaysOnTop\\PowerToys.AlwaysOnTop.exe",
|
||||
"modules\\AlwaysOnTop\\PowerToys.AlwaysOnTopModuleInterface.dll",
|
||||
|
||||
"modules\\Awake\\PowerToys.AwakeModuleInterface.dll",
|
||||
"modules\\Awake\\PowerToys.Awake.exe",
|
||||
"modules\\Awake\\PowerToys.Awake.dll",
|
||||
@@ -52,12 +51,16 @@
|
||||
"modules\\FileExplorerPreview\\PowerToys.ManagedTelemetry.dll",
|
||||
"modules\\FileExplorerPreview\\PowerToys.MarkdownPreviewHandler.dll",
|
||||
"modules\\FileExplorerPreview\\PowerToys.MarkdownPreviewHandler.comhost.dll",
|
||||
"modules\\FileExplorerPreview\\PowerToys.MonacoPreviewHandler.dll",
|
||||
"modules\\FileExplorerPreview\\PowerToys.MonacoPreviewHandler.comhost.dll",
|
||||
"modules\\FileExplorerPreview\\PowerToys.PdfPreviewHandler.dll",
|
||||
"modules\\FileExplorerPreview\\PowerToys.PdfPreviewHandler.comhost.dll",
|
||||
"modules\\FileExplorerPreview\\PowerToys.PdfThumbnailProvider.dll",
|
||||
"modules\\FileExplorerPreview\\PowerToys.PdfThumbnailProvider.comhost.dll",
|
||||
"modules\\FileExplorerPreview\\PowerToys.powerpreview.dll",
|
||||
"modules\\FileExplorerPreview\\PowerToys.PreviewHandlerCommon.dll",
|
||||
"modules\\FileExplorerPreview\\PowerToys.StlThumbnailProvider.dll",
|
||||
"modules\\FileExplorerPreview\\PowerToys.StlThumbnailProvider.comhost.dll",
|
||||
"modules\\FileExplorerPreview\\PowerToys.SvgPreviewHandler.dll",
|
||||
"modules\\FileExplorerPreview\\PowerToys.SvgPreviewHandler.comhost.dll",
|
||||
"modules\\FileExplorerPreview\\PowerToys.SvgThumbnailProvider.dll",
|
||||
@@ -91,11 +94,14 @@
|
||||
"modules\\launcher\\Plugins\\VSCodeWorkspaces\\Community.PowerToys.Run.Plugin.VSCodeWorkspaces.dll",
|
||||
"modules\\launcher\\Plugins\\Service\\Microsoft.PowerToys.Run.Plugin.Service.dll",
|
||||
"modules\\launcher\\Plugins\\System\\Microsoft.PowerToys.Run.Plugin.System.dll",
|
||||
"modules\\launcher\\Plugins\\TimeDate\\Microsoft.PowerToys.Run.Plugin.TimeDate.dll",
|
||||
"modules\\launcher\\Plugins\\TimeZone\\Microsoft.PowerToys.Run.Plugin.TimeZone.dll",
|
||||
"modules\\launcher\\Plugins\\WebSearch\\Community.PowerToys.Run.Plugin.WebSearch.dll",
|
||||
"modules\\launcher\\Plugins\\WindowsTerminal\\Microsoft.PowerToys.Run.Plugin.WindowsTerminal.dll",
|
||||
|
||||
"modules\\MouseUtils\\PowerToys.FindMyMouse.dll",
|
||||
"modules\\MouseUtils\\PowerToys.MouseHighlighter.dll",
|
||||
"modules\\MouseUtils\\PowerToys.MousePointerCrosshairs.dll",
|
||||
|
||||
"modules\\PowerRename\\PowerToys.PowerRenameExt.dll",
|
||||
"modules\\PowerRename\\PowerToys.PowerRenameUILib.dll",
|
||||
@@ -154,7 +160,6 @@
|
||||
},
|
||||
{
|
||||
"MatchedPath": [
|
||||
"Microsoft.Search.Interop.dll",
|
||||
"ModernWpf.dll",
|
||||
"ModernWpf.Controls.dll",
|
||||
"System.IO.Abstractions.dll",
|
||||
@@ -165,9 +170,10 @@
|
||||
"NLog.dll",
|
||||
"HtmlAgilityPack.dll",
|
||||
"Markdig.Signed.dll",
|
||||
"HelixToolkit.dll",
|
||||
"HelixToolkit.Core.Wpf.dll",
|
||||
"Mages.Core.dll",
|
||||
"JetBrains.Annotations.dll",
|
||||
"ICSharpCode.SharpZipLib.dll",
|
||||
"NLog.Extensions.Logging.dll",
|
||||
"concrt140_app.dll",
|
||||
"msvcp140_1_app.dll",
|
||||
@@ -178,6 +184,14 @@
|
||||
"vcomp140_app.dll",
|
||||
"vcruntime140_1_app.dll",
|
||||
"vcruntime140_app.dll",
|
||||
"modules\\FileExplorerPreview\\Microsoft.Web.WebView2.Core.dll",
|
||||
"modules\\FileExplorerPreview\\Microsoft.Web.WebView2.WinForms.dll",
|
||||
"modules\\FileExplorerPreview\\Microsoft.Web.WebView2.Wpf.dll",
|
||||
"modules\\FileExplorerPreview\\runtimes\\win-x64\\native\\WebView2Loader.dll",
|
||||
"modules\\launcher\\e_sqlite3.dll",
|
||||
"modules\\launcher\\SQLitePCLRaw.batteries_v2.dll",
|
||||
"modules\\launcher\\SQLitePCLRaw.core.dll",
|
||||
"modules\\launcher\\SQLitePCLRaw.provider.e_sqlite3.dll",
|
||||
"ColorCode.Core.dll",
|
||||
"ColorCode.UWP.dll",
|
||||
"UnitsNet.dll"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
cd /D "%~dp0"
|
||||
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 -winsdk=10.0.18362.0
|
||||
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 -winsdk=10.0.18362.0
|
||||
SET IsPipeline=1
|
||||
call msbuild ../installer/PowerToysSetup.sln /target:PowerToysInstaller /p:Configuration=Release /p:Platform=x64 /p:CIBuild=true || exit /b 1
|
||||
|
||||
@@ -10,6 +10,7 @@ jobs:
|
||||
BuildConfiguration: ${{ parameters.configuration }}
|
||||
BuildPlatform: ${{ parameters.platform }}
|
||||
pool:
|
||||
demands: ImageOverride -equals WinDevVS17-latest
|
||||
${{ if eq(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||
name: WinDevPoolOSS-L
|
||||
${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||
|
||||
@@ -7,12 +7,20 @@ steps:
|
||||
submodules: true
|
||||
clean: true
|
||||
|
||||
- task: NuGetToolInstaller@0
|
||||
displayName: Ensure NuGet 5.8.0
|
||||
- task: UseDotNet@2
|
||||
displayName: 'Use .NET 3.1 for unit test SDK'
|
||||
inputs:
|
||||
versionSpec: 5.8.0
|
||||
packageType: sdk
|
||||
version: '3.1.x'
|
||||
|
||||
#- template: .\..\..\..\restore-dependencies.yml
|
||||
- task: UseDotNet@2
|
||||
displayName: 'Use .NET 6 SDK'
|
||||
inputs:
|
||||
packageType: sdk
|
||||
version: '6.x'
|
||||
|
||||
- task: NuGetToolInstaller@1
|
||||
displayName: Ensure NuGet Installer
|
||||
|
||||
- task: VisualStudioTestPlatformInstaller@1
|
||||
displayName: Ensure VSTest Platform
|
||||
@@ -30,7 +38,7 @@ steps:
|
||||
displayName: 'Build PowerToys.sln'
|
||||
inputs:
|
||||
solution: '**\PowerToys.sln'
|
||||
vsVersion: 16.0
|
||||
vsVersion: 17.0
|
||||
platform: '$(BuildPlatform)'
|
||||
configuration: '$(BuildConfiguration)'
|
||||
msbuildArgs: ${{ parameters.additionalBuildArguments }}
|
||||
@@ -49,7 +57,7 @@ steps:
|
||||
displayName: 'Build BugReportTool.sln'
|
||||
inputs:
|
||||
solution: '**\BugReportTool.sln'
|
||||
vsVersion: 16.0
|
||||
vsVersion: 17.0
|
||||
platform: '$(BuildPlatform)'
|
||||
configuration: '$(BuildConfiguration)'
|
||||
msbuildArgs: ${{ parameters.additionalBuildArguments }}
|
||||
@@ -68,7 +76,7 @@ steps:
|
||||
displayName: 'Build WebcamReportTool.sln'
|
||||
inputs:
|
||||
solution: '**\WebcamReportTool.sln'
|
||||
vsVersion: 16.0
|
||||
vsVersion: 17.0
|
||||
platform: '$(BuildPlatform)'
|
||||
configuration: '$(BuildConfiguration)'
|
||||
msbuildArgs: ${{ parameters.additionalBuildArguments }}
|
||||
@@ -84,13 +92,24 @@ steps:
|
||||
restoreDirectory: '$(Build.SourcesDirectory)\installer\packages'
|
||||
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build PowerToysSetup.sln'
|
||||
displayName: 'Build PowerToys MSI'
|
||||
inputs:
|
||||
solution: '**\installer\PowerToysSetup.sln'
|
||||
vsVersion: 16.0
|
||||
vsVersion: 17.0
|
||||
platform: '$(BuildPlatform)'
|
||||
configuration: '$(BuildConfiguration)'
|
||||
msbuildArgs: ${{ parameters.additionalBuildArguments }}
|
||||
msbuildArgs: /t:PowerToysInstaller ${{ parameters.additionalBuildArguments }}
|
||||
maximumCpuCount: true
|
||||
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build PowerToys Bootstrapper'
|
||||
inputs:
|
||||
solution: '**\installer\PowerToysSetup.sln'
|
||||
vsVersion: 17.0
|
||||
platform: '$(BuildPlatform)'
|
||||
configuration: '$(BuildConfiguration)'
|
||||
msbuildArgs: /t:PowerToysBootstrapper ${{ parameters.additionalBuildArguments }}
|
||||
clean: false
|
||||
maximumCpuCount: true
|
||||
|
||||
# directly not doing WinAppDriver testing
|
||||
@@ -103,6 +122,7 @@ steps:
|
||||
testAssemblyVer2: |
|
||||
**\UnitTests-GcodeThumbnailProvider.dll
|
||||
**\UnitTests-SvgThumbnailProvider.dll
|
||||
**\UnitTests-StlThumbnailProvider.dll
|
||||
**\UnitTests-PdfThumbnailProvider.dll
|
||||
**\Settings.UI.UnitTests.dll
|
||||
**\UnitTests-MarkdownPreviewHandler.dll
|
||||
@@ -121,9 +141,12 @@ steps:
|
||||
**\Microsoft.PowerToys.Run.Plugin.Calculator.UnitTest.dll
|
||||
**\Microsoft.Plugin.Uri.UnitTests.dll
|
||||
**\Wox.Test.dll
|
||||
**\Microsoft.PowerToys.Run.Plugin.System.UnitTests.dll
|
||||
**\Microsoft.PowerToys.Run.Plugin.WindowsTerminal.UnitTests.dll
|
||||
**\Microsoft.PowerToys.Run.Plugin.System.UnitTests.dll
|
||||
**\Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests.dll
|
||||
**\Microsoft.Plugin.WindowsTerminal.UnitTests.dll
|
||||
**\Microsoft.Plugin.WindowWalker.UnitTests.dll
|
||||
!**\obj\**
|
||||
!**\ref\**
|
||||
|
||||
# Native dlls
|
||||
- task: VSTest@2
|
||||
|
||||
@@ -4,7 +4,7 @@ pr: none
|
||||
|
||||
pool:
|
||||
name: WinDevPool-L
|
||||
demands: ImageOverride -equals WinDevVS16-latest
|
||||
demands: ImageOverride -equals WinDevVS17-latest
|
||||
|
||||
parameters:
|
||||
- name: buildConfigurations
|
||||
@@ -53,37 +53,26 @@ jobs:
|
||||
scriptName: .pipelines/versionSetting.ps1
|
||||
arguments: -versionNumber '${{ parameters.versionNumber }}' -DevEnvironment ''
|
||||
|
||||
- task: MicrosoftTDBuild.tdbuild-task.tdbuild-task.TouchdownBuildTask@1
|
||||
displayName: 'Download Localization Files -- PowerToys 37400'
|
||||
# Guardian tool needs 'Microsoft.NETCore.App', version '2.1.0' (x64)
|
||||
- task: UseDotNet@2
|
||||
displayName: 'Use .NET Core 2.1 SDK'
|
||||
inputs:
|
||||
teamId: 37400
|
||||
authId: '$(TouchdownApplicationID)'
|
||||
authKey: '$(TouchdownApplicationKey)'
|
||||
resourceFilePath: |
|
||||
**\Resources.resx
|
||||
**\Resource.resx
|
||||
**\Resources.resw
|
||||
appendRelativeDir: true
|
||||
localizationTarget: false
|
||||
pseudoSetting: Included
|
||||
- task: PowerShell@2
|
||||
displayName: Move Loc files into correct locations
|
||||
packageType: sdk
|
||||
version: '2.1.x'
|
||||
|
||||
- task: UseDotNet@2
|
||||
displayName: 'Use .NET 6 SDK'
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: >-
|
||||
$VerbosePreference = "Continue"
|
||||
packageType: sdk
|
||||
version: '6.x'
|
||||
|
||||
./tools/build/move-and-rename-resx.ps1
|
||||
|
||||
./tools/build/move-uwp-resw.ps1
|
||||
pwsh: true
|
||||
- task: NuGetAuthenticate@0
|
||||
inputs:
|
||||
nuGetServiceConnections: PowerToysCDPxFeed
|
||||
|
||||
- task: NuGetToolInstaller@1
|
||||
displayName: Use NuGet 5.10
|
||||
inputs:
|
||||
versionSpec: 5.10
|
||||
displayName: Use NuGet Installer latest
|
||||
|
||||
# this will restore the following nugets:
|
||||
# - main solution
|
||||
# - Bug report tool
|
||||
@@ -98,6 +87,32 @@ jobs:
|
||||
selectOrConfig: config
|
||||
nugetConfigPath: .pipelines/release-nuget.config
|
||||
|
||||
- task: MicrosoftTDBuild.tdbuild-task.tdbuild-task.TouchdownBuildTask@1
|
||||
displayName: 'Download Localization Files -- PowerToys 37400'
|
||||
inputs:
|
||||
teamId: 37400
|
||||
authId: '$(TouchdownApplicationID)'
|
||||
authKey: '$(TouchdownApplicationKey)'
|
||||
resourceFilePath: |
|
||||
**\Resources.resx
|
||||
**\Resource.resx
|
||||
**\Resources.resw
|
||||
appendRelativeDir: true
|
||||
localizationTarget: false
|
||||
# pseudoSetting: Included
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: Move Loc files into correct locations
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: >-
|
||||
$VerbosePreference = "Continue"
|
||||
|
||||
./tools/build/move-and-rename-resx.ps1
|
||||
|
||||
./tools/build/move-uwp-resw.ps1
|
||||
pwsh: true
|
||||
|
||||
- task: CmdLine@2
|
||||
displayName: Moving telem files
|
||||
inputs:
|
||||
@@ -111,7 +126,7 @@ jobs:
|
||||
displayName: Build PowerToys main project
|
||||
inputs:
|
||||
solution: '**\PowerToys.sln'
|
||||
vsVersion: 16.0
|
||||
vsVersion: 17.0
|
||||
msbuildArgs: /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
|
||||
platform: $(BuildPlatform)
|
||||
configuration: $(BuildConfiguration)
|
||||
@@ -122,7 +137,7 @@ jobs:
|
||||
displayName: Build BugReportTool
|
||||
inputs:
|
||||
solution: '**/tools/BugReportTool/BugReportTool.sln'
|
||||
vsVersion: 16.0
|
||||
vsVersion: 17.0
|
||||
msbuildArgs: /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
|
||||
platform: $(BuildPlatform)
|
||||
configuration: $(BuildConfiguration)
|
||||
@@ -133,7 +148,7 @@ jobs:
|
||||
displayName: Build WebcamReportTool
|
||||
inputs:
|
||||
solution: '**/tools/WebcamReportTool/WebcamReportTool.sln'
|
||||
vsVersion: 16.0
|
||||
vsVersion: 17.0
|
||||
msbuildArgs: /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
|
||||
platform: $(BuildPlatform)
|
||||
configuration: $(BuildConfiguration)
|
||||
@@ -144,7 +159,7 @@ jobs:
|
||||
displayName: Build PowerToysSetupCustomActions
|
||||
inputs:
|
||||
solution: '**/installer/PowerToysSetup.sln'
|
||||
vsVersion: 16.0
|
||||
vsVersion: 17.0
|
||||
msbuildArgs: /target:PowerToysSetupCustomActions /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
|
||||
platform: $(BuildPlatform)
|
||||
configuration: $(BuildConfiguration)
|
||||
@@ -155,7 +170,7 @@ jobs:
|
||||
displayName: Publish Settings for Packaging
|
||||
inputs:
|
||||
solution: 'src/settings-ui/PowerToys.Settings/PowerToys.Settings.csproj'
|
||||
vsVersion: 16.0
|
||||
vsVersion: 17.0
|
||||
msbuildArgs: >-
|
||||
/target:Publish
|
||||
/p:Configuration=$(BuildConfiguration);Platform=$(BuildPlatform);AppxBundle=Never
|
||||
@@ -170,7 +185,7 @@ jobs:
|
||||
displayName: Publish Launcher for Packaging
|
||||
inputs:
|
||||
solution: 'src/modules/launcher/PowerLauncher/PowerLauncher.csproj'
|
||||
vsVersion: 16.0
|
||||
vsVersion: 17.0
|
||||
# The arguments should be the same as the ones for Settings; make sure they are.
|
||||
msbuildArgs: >-
|
||||
/target:Publish
|
||||
@@ -185,6 +200,7 @@ jobs:
|
||||
#### MAIN SIGNING AREA
|
||||
# reference https://dev.azure.com/microsoft/Dart/_git/AppDriver?path=/ESRPSigning.json&version=GBarm64-netcore&_a=contents for winappdriver
|
||||
# https://dev.azure.com/microsoft/Dart/_git/AppDriver?path=/CIPolicy.xml&version=GBarm64-netcore&_a=contents
|
||||
|
||||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
|
||||
displayName: Sign Core PT
|
||||
inputs:
|
||||
@@ -210,13 +226,27 @@ jobs:
|
||||
displayName: Build MSI
|
||||
inputs:
|
||||
solution: '**/installer/PowerToysSetup.sln'
|
||||
vsVersion: 16.0
|
||||
vsVersion: 17.0
|
||||
msbuildArgs: /p:CIBuild=true /target:PowerToysInstaller /bl:$(Build.SourcesDirectory)\msbuild.binlog
|
||||
platform: $(BuildPlatform)
|
||||
configuration: $(BuildConfiguration)
|
||||
clean: true
|
||||
maximumCpuCount: true
|
||||
|
||||
- task: CmdLine@2
|
||||
displayName: 'Extracting MSI to verify contents'
|
||||
inputs:
|
||||
script: |
|
||||
.\installer\packages\WiX.3.11.2\tools\dark.exe -x $(build.sourcesdirectory)\extractedMsi installer\PowerToysSetup\$(BuildPlatform)\$(BuildConfiguration)\PowerToysSetup-${{ parameters.versionNumber }}-$(BuildPlatform).msi
|
||||
dir $(build.sourcesdirectory)\extractedMsi
|
||||
|
||||
# Did we sign all files
|
||||
- task: PowerShell@1
|
||||
displayName: Verifying entire build is signed and version set
|
||||
inputs:
|
||||
scriptName: .pipelines/versionAndSignCheck.ps1
|
||||
arguments: -targetDir '$(build.sourcesdirectory)\extractedMsi\File'
|
||||
|
||||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
|
||||
displayName: Sign MSI
|
||||
inputs:
|
||||
@@ -232,11 +262,11 @@ jobs:
|
||||
displayName: Build Bootstrapper
|
||||
inputs:
|
||||
solution: '**/installer/PowerToysSetup.sln'
|
||||
vsVersion: 16.0
|
||||
msbuildArgs: /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
|
||||
vsVersion: 17.0
|
||||
msbuildArgs: /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog /t:PowerToysBootstrapper
|
||||
platform: $(BuildPlatform)
|
||||
configuration: $(BuildConfiguration)
|
||||
clean: true
|
||||
clean: false # don't undo our hard work above by deleting the MSI
|
||||
maximumCpuCount: true
|
||||
|
||||
- task: CmdLine@2
|
||||
@@ -282,7 +312,7 @@ jobs:
|
||||
script: '.\installer\packages\WiX.3.11.2\tools\insignia.exe -ab installer\engine.exe installer\PowerToysSetup\$(BuildPlatform)\$(BuildConfiguration)\PowerToysSetup-${{ parameters.versionNumber }}-$(BuildPlatform).exe -o installer\PowerToysSetup\$(BuildPlatform)\$(BuildConfiguration)\PowerToysSetup-${{ parameters.versionNumber }}-$(BuildPlatform).exe'
|
||||
|
||||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
|
||||
displayName: Sign Boostrapper
|
||||
displayName: Sign Bootstrapper
|
||||
inputs:
|
||||
ConnectedServiceName: 'Terminal/Console/WinAppDriver Team Code Signing Connection'
|
||||
FolderPath: 'installer/PowerToysSetup/$(BuildPlatform)\$(BuildConfiguration)'
|
||||
@@ -304,14 +334,54 @@ jobs:
|
||||
displayName: Component Detection
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: Copying files for symbols
|
||||
inputs:
|
||||
contents: >-
|
||||
**/*.pdb
|
||||
flattenFolders: True
|
||||
targetFolder: $(Build.ArtifactStagingDirectory)/Symbols/
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Remove unneeded files from ArtifactStagingDirectory'
|
||||
inputs:
|
||||
targetType: 'inline'
|
||||
script: |
|
||||
cd $(Build.ArtifactStagingDirectory)/Symbols/
|
||||
Remove-Item vc143.pdb
|
||||
Remove-Item *test*
|
||||
|
||||
- task: PublishSymbols@2
|
||||
displayName: Publish symbols path
|
||||
continueOnError: True
|
||||
inputs:
|
||||
SearchPattern: |
|
||||
$(Build.ArtifactStagingDirectory)/Symbols/**/*.*
|
||||
IndexSources: false
|
||||
SymbolServerType: TeamServices
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish Artifact: Symbols'
|
||||
inputs:
|
||||
PathtoPublish: $(System.ArtifactsDirectory)/Symbols/
|
||||
ArtifactName: Symbols
|
||||
|
||||
- task: DeleteFiles@1
|
||||
displayName: 'Remove symbols from ArtifactStagingDirectory'
|
||||
inputs:
|
||||
Contents: '*'
|
||||
SourceFolder: $(Build.ArtifactStagingDirectory)/Symbols/
|
||||
RemoveSourceFolder: True
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: Copying setup file over
|
||||
inputs:
|
||||
contents: '**/PowerToysSetup-*.exe'
|
||||
flattenFolders: True
|
||||
targetFolder: $(Build.ArtifactStagingDirectory)
|
||||
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish Artifact: PowerToySetup'
|
||||
inputs:
|
||||
PathtoPublish: $(System.ArtifactsDirectory)
|
||||
ArtifactName: BuildArtifacts
|
||||
ArtifactName: setup-$(BuildPlatform)
|
||||
...
|
||||
|
||||
50
.pipelines/versionAndSignCheck.ps1
Normal file
50
.pipelines/versionAndSignCheck.ps1
Normal file
@@ -0,0 +1,50 @@
|
||||
[CmdletBinding()]
|
||||
# todo: send in arch / conf, could send in actual path
|
||||
Param(
|
||||
[Parameter(Mandatory=$True,Position=1)]
|
||||
[AllowEmptyString()]
|
||||
[string]$targetDir = $PSScriptRoot + '/../extractedMsi/File'
|
||||
)
|
||||
|
||||
$DirPath = $targetDir; #this file is in pipeline, we need root.
|
||||
$items = Get-ChildItem -Path $DirPath -File -Include *.exe,*.dll,*.ttf -Recurse -Force -ErrorAction SilentlyContinue
|
||||
$totalFailure = 0;
|
||||
|
||||
Write-Host $DirPath;
|
||||
|
||||
if(-not (Test-Path $DirPath))
|
||||
{
|
||||
Write-Host "Folder does not exist!"
|
||||
}
|
||||
|
||||
Write-Host "Total items: " $items.Count
|
||||
|
||||
if($items.Count -eq 0)
|
||||
{
|
||||
# no items means something bad happened. We should fail ASAP
|
||||
exit 1;
|
||||
}
|
||||
|
||||
$items | ForEach-Object {
|
||||
if($_.VersionInfo.FileVersion -eq "1.0.0.0" )
|
||||
{
|
||||
Write-Host "Version not set: " + $_.FullName
|
||||
$totalFailure++;
|
||||
}
|
||||
}
|
||||
|
||||
$items | ForEach-Object {
|
||||
$auth = Get-AuthenticodeSignature $_.FullName
|
||||
if($auth.SignerCertificate -eq $null)
|
||||
{
|
||||
Write-Host "Not Signed: " + $_.FullName
|
||||
$totalFailure++;
|
||||
}
|
||||
}
|
||||
|
||||
if($totalFailure -gt 0)
|
||||
{
|
||||
exit 1
|
||||
}
|
||||
|
||||
exit 0
|
||||
@@ -6,7 +6,6 @@
|
||||
"Microsoft.VisualStudio.Workload.NativeDesktop",
|
||||
"Microsoft.VisualStudio.Workload.ManagedDesktop",
|
||||
"Microsoft.VisualStudio.Workload.Universal",
|
||||
"Microsoft.VisualStudio.Component.Windows10SDK.17134",
|
||||
"Microsoft.VisualStudio.Component.Windows10SDK.18362",
|
||||
"Microsoft.VisualStudio.ComponentGroup.UWP.VC",
|
||||
"Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre",
|
||||
|
||||
11
COMMUNITY.md
11
COMMUNITY.md
@@ -6,11 +6,20 @@ Names are in alphabetical order based on first name.
|
||||
|
||||
## High impact community members
|
||||
|
||||
### [@Aaron-Junker](https://github.com/Aaron-Junker) - [Aaron Junker](https://aaron-junker.github.io)
|
||||
Aaron has helped triaging, discussing, and creating a substantial number of issues and contributed features/fixes as well as work on an upcoming utility.
|
||||
|
||||
### [@davidegiacometti](https://github.com/davidegiacometti) - [Davide Giacometti](https://www.linkedin.com/in/davidegiacometti/)
|
||||
Davide has helped fix multiple bugs, added new features, as well as help us with the ARM64 effort by porting applications to .NET Core.
|
||||
|
||||
### [@franky920920](https://github.com/franky920920) - [Franky Chen](https://frankychen.net)
|
||||
Franky has helped triaging, discussing, and creating a substantial number of issues and contributed features/fixes to PowerToys.
|
||||
|
||||
### [@htcfreek](https://github.com/htcfreek) - Heiko
|
||||
Heiko has helped triaging, discussing, and creating a substantial number of issues and contributed features/fixes to PowerToys Run.
|
||||
Heiko has helped triaging, discussing, and creating a substantial number of issues and contributed features/fixes to PowerToys.
|
||||
|
||||
### [@Jay-o-Way](https://github.com/Jay-o-Way) - Jay
|
||||
Jay has helped triaging, discussing, creating a substantial number of issues and PRs.
|
||||
|
||||
### [@jsoref](https://github.com/jsoref) - [Josh Soref](https://check-spelling.dev/)
|
||||
Helping keep our spelling correct :)
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
|
||||
<!-- Props that are constant for both Debug and Release configurations -->
|
||||
<PropertyGroup Label="Configuration">
|
||||
<PlatformToolset Condition="'$(OverridePlatformToolset)'!='True'">v142</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(OverridePlatformToolset)'!='True'">v143</PlatformToolset>
|
||||
<IntDir>$(SolutionDir)$(Platform)\$(Configuration)\obj\$(ProjectName)\</IntDir>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,8 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project>
|
||||
|
||||
<PropertyGroup>
|
||||
<Copyright>Copyright (C) 2022 Microsoft Corporation</Copyright>
|
||||
<AssemblyCompany>Microsoft Corp.</AssemblyCompany>
|
||||
<AssemblyCopyright>Copyright (C) 2022 Microsoft Corporation</AssemblyCopyright>
|
||||
<AssemblyProduct>PowerToys</AssemblyProduct>
|
||||
<Company>Microsoft Corporation</Company>
|
||||
<NeutralLanguage>en-US</NeutralLanguage>
|
||||
<Platforms>x64</Platforms>
|
||||
<PackageTags>PowerToys</PackageTags>
|
||||
<EnableNETAnalyzers>true</EnableNETAnalyzers>
|
||||
<AnalysisMode>Recommended</AnalysisMode>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.csproj'">
|
||||
<RepositoryUrl>https://github.com/microsoft/PowerToys</RepositoryUrl>
|
||||
<RepositoryType>Github</RepositoryType>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.csproj'">
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<_PropertySheetDisplayName>PowerToys.Root.Props</_PropertySheetDisplayName>
|
||||
<ForceImportBeforeCppProps>$(MsbuildThisFileDirectory)\Cpp.Build.props</ForceImportBeforeCppProps>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
44
NOTICE.md
44
NOTICE.md
@@ -1,7 +1,13 @@
|
||||
# NOTICES AND INFORMATION
|
||||
This software incorporates material from third parties.
|
||||
|
||||
## PowerToy: Color Picker
|
||||
- Color Picker
|
||||
- File Explorer Add-ins
|
||||
- ImageResizer
|
||||
- PowerToys Run
|
||||
- Installer/Runner
|
||||
|
||||
## Utility: Color Picker
|
||||
|
||||
### Martin Chrzan's Color Picker
|
||||
|
||||
@@ -29,7 +35,37 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
## PowerToy: ImageResizer
|
||||
## Utility: File Explorer Add-ins
|
||||
|
||||
### Monaco Editor
|
||||
|
||||
**Source**: https://github.com/Microsoft/monaco-editor
|
||||
|
||||
**Additional third party notifications:** https://github.com/microsoft/monaco-editor/blob/main/ThirdPartyNotices.txt
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 - present Microsoft Corporation
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
## Utility: ImageResizer
|
||||
|
||||
### Brice Lams's Image Resizer License
|
||||
|
||||
@@ -57,7 +93,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
## PowerToy: Launcher
|
||||
## Utility: PowerToys Run
|
||||
|
||||
### Wox License
|
||||
|
||||
@@ -99,7 +135,7 @@ The above copyright notice and this permission notice shall be included in all c
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
## PowerToy: PowerRename
|
||||
## Utility: PowerRename
|
||||
|
||||
### Chris Davis's SmartRename License
|
||||
|
||||
|
||||
105
PowerToys.sln
105
PowerToys.sln
@@ -1,6 +1,6 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.28803.452
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.0.32014.148
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "runner", "src\runner\runner.vcxproj", "{9412D5C6-2CF2-4FC2-A601-B55508EA9B27}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
@@ -9,7 +9,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "runner", "src\runner\runner
|
||||
{51920F1F-C28C-4ADF-8660-4238766796C2} = {51920F1F-C28C-4ADF-8660-4238766796C2}
|
||||
{6A71162E-FC4C-4A2C-B90F-3CF94F59A9BB} = {6A71162E-FC4C-4A2C-B90F-3CF94F59A9BB}
|
||||
{031AC72E-FA28-4AB7-B690-6F7B9C28AA73} = {031AC72E-FA28-4AB7-B690-6F7B9C28AA73}
|
||||
{0485F45C-EA7A-4BB5-804B-3E8D14699387} = {0485F45C-EA7A-4BB5-804B-3E8D14699387}
|
||||
{D29DDD63-E2CF-4657-9FD5-2AEDE4257E5D} = {D29DDD63-E2CF-4657-9FD5-2AEDE4257E5D}
|
||||
{5CCC8468-DEC8-4D36-99D4-5C891BEBD481} = {5CCC8468-DEC8-4D36-99D4-5C891BEBD481}
|
||||
{BA58206B-1493-4C75-BFEA-A85768A1E156} = {BA58206B-1493-4C75-BFEA-A85768A1E156}
|
||||
@@ -74,8 +73,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PowerRenameUnitTests", "src
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ModuleTemplateCompileTest", "tools\project_template\ModuleTemplate\ModuleTemplateCompileTest.vcxproj", "{64A80062-4D8B-4229-8A38-DFA1D7497749}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PowerRenameUWPUI", "src\modules\powerrename\UWPui\PowerRenameUWPUI.vcxproj", "{0485F45C-EA7A-4BB5-804B-3E8D14699387}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KeyboardManager", "src\modules\keyboardmanager\dll\KeyboardManager.vcxproj", "{89F34AF7-1C34-4A72-AA6E-534BCF972BD9}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "imageresizer", "imageresizer", "{6C7F47CC-2151-44A3-A546-41C70025132C}"
|
||||
@@ -139,6 +136,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerLauncher", "src\module
|
||||
{C21BFF9C-2C99-4B5F-B7C9-A5E6DDDB37B0} = {C21BFF9C-2C99-4B5F-B7C9-A5E6DDDB37B0}
|
||||
{0351ADA4-0C32-4652-9BA0-41F7B602372B} = {0351ADA4-0C32-4652-9BA0-41F7B602372B}
|
||||
{787B8AA6-CA93-4C84-96FE-DF31110AD1C4} = {787B8AA6-CA93-4C84-96FE-DF31110AD1C4}
|
||||
{F44934A8-36F3-49B0-9465-3831BE041CDE} = {F44934A8-36F3-49B0-9465-3831BE041CDE}
|
||||
{5BDBD6C9-A31F-4CEB-871A-5E9E709197EF} = {5BDBD6C9-A31F-4CEB-871A-5E9E709197EF}
|
||||
{5043CECE-E6A7-4867-9CBE-02D27D83747A} = {5043CECE-E6A7-4867-9CBE-02D27D83747A}
|
||||
{F8B870EB-D5F5-45BA-9CF7-A5C459818820} = {F8B870EB-D5F5-45BA-9CF7-A5C459818820}
|
||||
{74F1B9ED-F59C-4FE7-B473-7B453E30837E} = {74F1B9ED-F59C-4FE7-B473-7B453E30837E}
|
||||
@@ -177,7 +176,8 @@ EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4981CCD1-4CD9-4A49-B240-00AA46493FF8}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
src\.editorconfig = src\.editorconfig
|
||||
src\tests\win-app-driver\packages.config = src\tests\win-app-driver\packages.config
|
||||
.vsconfig = .vsconfig
|
||||
Directory.Build.props = Directory.Build.props
|
||||
Solution.props = Solution.props
|
||||
EndProjectSection
|
||||
EndProject
|
||||
@@ -268,6 +268,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "utils", "utils", "{B39DC643
|
||||
src\common\utils\elevation.h = src\common\utils\elevation.h
|
||||
src\common\utils\EventLocker.h = src\common\utils\EventLocker.h
|
||||
src\common\utils\EventWaiter.h = src\common\utils\EventWaiter.h
|
||||
src\common\utils\excluded_apps.h = src\common\utils\excluded_apps.h
|
||||
src\common\utils\exec.h = src\common\utils\exec.h
|
||||
src\common\utils\game_mode.h = src\common\utils\game_mode.h
|
||||
src\common\utils\HDropIterator.h = src\common\utils\HDropIterator.h
|
||||
@@ -360,7 +361,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests-PdfThumbnailProvi
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.PowerToys.Run.Plugin.WindowsTerminal", "src\modules\launcher\Plugins\Microsoft.PowerToys.Run.Plugin.WindowsTerminal\Microsoft.PowerToys.Run.Plugin.WindowsTerminal.csproj", "{A2D583F0-B70C-4462-B1F0-8E81AFB7BA85}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.PowerToys.Run.Plugin.WindowsTerminal.UnitTests", "src\modules\launcher\Plugins\Microsoft.PowerToys.Run.Plugin.WindowsTerminal.UnitTests\Microsoft.PowerToys.Run.Plugin.WindowsTerminal.UnitTests.csproj", "{4ED320BC-BA04-4D42-8D15-CBE62151F08B}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Plugin.WindowsTerminal.UnitTests", "src\modules\launcher\Plugins\Microsoft.PowerToys.Run.Plugin.WindowsTerminal.UnitTests\Microsoft.Plugin.WindowsTerminal.UnitTests.csproj", "{4ED320BC-BA04-4D42-8D15-CBE62151F08B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PowerRenameUIHost", "src\modules\powerrename\PowerRenameUIHost\PowerRenameUIHost.vcxproj", "{F7EC4E6C-19CA-4FBD-9918-B8AC5FEF4F63}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
@@ -391,6 +392,21 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AlwaysOnTopModuleInterface"
|
||||
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}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StlThumbnailProvider", "src\modules\previewpane\StlThumbnailProvider\StlThumbnailProvider.csproj", "{F7C8C0F1-5431-4347-89D0-8E5354F93CF2}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests-StlThumbnailProvider", "src\modules\previewpane\UnitTests-StlThumbnailProvider\UnitTests-StlThumbnailProvider.csproj", "{F1F6B6B6-9F18-4A17-8B5C-97DF552C53DC}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MonacoPreviewHandler", "src\modules\previewpane\MonacoPreviewHandler\MonacoPreviewHandler.csproj", "{04B193D7-3E21-46B8-A958-89B63A8A69DE}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.PowerToys.Run.Plugin.TimeZone", "src\modules\launcher\Plugins\Microsoft.PowerToys.Run.Plugin.TimeZone\Microsoft.PowerToys.Run.Plugin.TimeZone.csproj", "{F44934A8-36F3-49B0-9465-3831BE041CDE}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.PowerToys.Run.Plugin.TimeDate", "src\modules\launcher\Plugins\Microsoft.PowerToys.Run.Plugin.TimeDate\Microsoft.PowerToys.Run.Plugin.TimeDate.csproj", "{5BDBD6C9-A31F-4CEB-871A-5E9E709197EF}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests", "src\modules\launcher\Plugins\Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests\Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests.csproj", "{FD464B4C-2F68-4D06-91E7-4208146C41F5}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Plugin.WindowWalker.UnitTests", "src\modules\launcher\Plugins\Microsoft.Plugin.WindowWalker.UnitTests\Microsoft.Plugin.WindowWalker.UnitTests.csproj", "{8FE5A5EE-1B59-401C-9FB3-B04ECD3E29C1}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
@@ -459,12 +475,6 @@ Global
|
||||
{64A80062-4D8B-4229-8A38-DFA1D7497749}.Release|x64.ActiveCfg = Release|x64
|
||||
{64A80062-4D8B-4229-8A38-DFA1D7497749}.Release|x64.Build.0 = Release|x64
|
||||
{64A80062-4D8B-4229-8A38-DFA1D7497749}.Release|x86.ActiveCfg = Release|x64
|
||||
{0485F45C-EA7A-4BB5-804B-3E8D14699387}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{0485F45C-EA7A-4BB5-804B-3E8D14699387}.Debug|x64.Build.0 = Debug|x64
|
||||
{0485F45C-EA7A-4BB5-804B-3E8D14699387}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{0485F45C-EA7A-4BB5-804B-3E8D14699387}.Release|x64.ActiveCfg = Release|x64
|
||||
{0485F45C-EA7A-4BB5-804B-3E8D14699387}.Release|x64.Build.0 = Release|x64
|
||||
{0485F45C-EA7A-4BB5-804B-3E8D14699387}.Release|x86.ActiveCfg = Release|x64
|
||||
{89F34AF7-1C34-4A72-AA6E-534BCF972BD9}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{89F34AF7-1C34-4A72-AA6E-534BCF972BD9}.Debug|x64.Build.0 = Debug|x64
|
||||
{89F34AF7-1C34-4A72-AA6E-534BCF972BD9}.Debug|x86.ActiveCfg = Debug|x64
|
||||
@@ -986,8 +996,8 @@ Global
|
||||
{4ED320BC-BA04-4D42-8D15-CBE62151F08B}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{4ED320BC-BA04-4D42-8D15-CBE62151F08B}.Release|x64.ActiveCfg = Release|x64
|
||||
{4ED320BC-BA04-4D42-8D15-CBE62151F08B}.Release|x64.Build.0 = Release|x64
|
||||
{4ED320BC-BA04-4D42-8D15-CBE62151F08B}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{4ED320BC-BA04-4D42-8D15-CBE62151F08B}.Release|x86.Build.0 = Release|Any CPU
|
||||
{4ED320BC-BA04-4D42-8D15-CBE62151F08B}.Release|x86.ActiveCfg = Release|x64
|
||||
{4ED320BC-BA04-4D42-8D15-CBE62151F08B}.Release|x86.Build.0 = Release|x64
|
||||
{F7EC4E6C-19CA-4FBD-9918-B8AC5FEF4F63}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F7EC4E6C-19CA-4FBD-9918-B8AC5FEF4F63}.Debug|x64.Build.0 = Debug|x64
|
||||
{F7EC4E6C-19CA-4FBD-9918-B8AC5FEF4F63}.Debug|x86.ActiveCfg = Debug|x64
|
||||
@@ -1054,6 +1064,62 @@ Global
|
||||
{9F94B303-5E21-4364-9362-64426F8DB932}.Release|x64.ActiveCfg = Release|x64
|
||||
{9F94B303-5E21-4364-9362-64426F8DB932}.Release|x64.Build.0 = Release|x64
|
||||
{9F94B303-5E21-4364-9362-64426F8DB932}.Release|x86.ActiveCfg = Release|x64
|
||||
{EAE14C0E-7A6B-45DA-9080-A7D8C077BA6E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{EAE14C0E-7A6B-45DA-9080-A7D8C077BA6E}.Debug|x64.Build.0 = Debug|x64
|
||||
{EAE14C0E-7A6B-45DA-9080-A7D8C077BA6E}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{EAE14C0E-7A6B-45DA-9080-A7D8C077BA6E}.Release|x64.ActiveCfg = Release|x64
|
||||
{EAE14C0E-7A6B-45DA-9080-A7D8C077BA6E}.Release|x64.Build.0 = Release|x64
|
||||
{EAE14C0E-7A6B-45DA-9080-A7D8C077BA6E}.Release|x86.ActiveCfg = Release|x64
|
||||
{F7C8C0F1-5431-4347-89D0-8E5354F93CF2}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F7C8C0F1-5431-4347-89D0-8E5354F93CF2}.Debug|x64.Build.0 = Debug|x64
|
||||
{F7C8C0F1-5431-4347-89D0-8E5354F93CF2}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{F7C8C0F1-5431-4347-89D0-8E5354F93CF2}.Release|x64.ActiveCfg = Release|x64
|
||||
{F7C8C0F1-5431-4347-89D0-8E5354F93CF2}.Release|x64.Build.0 = Release|x64
|
||||
{F7C8C0F1-5431-4347-89D0-8E5354F93CF2}.Release|x86.ActiveCfg = Release|x64
|
||||
{F1F6B6B6-9F18-4A17-8B5C-97DF552C53DC}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F1F6B6B6-9F18-4A17-8B5C-97DF552C53DC}.Debug|x64.Build.0 = Debug|x64
|
||||
{F1F6B6B6-9F18-4A17-8B5C-97DF552C53DC}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{F1F6B6B6-9F18-4A17-8B5C-97DF552C53DC}.Release|x64.ActiveCfg = Release|x64
|
||||
{F1F6B6B6-9F18-4A17-8B5C-97DF552C53DC}.Release|x64.Build.0 = Release|x64
|
||||
{F1F6B6B6-9F18-4A17-8B5C-97DF552C53DC}.Release|x86.ActiveCfg = Release|x64
|
||||
{04B193D7-3E21-46B8-A958-89B63A8A69DE}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{04B193D7-3E21-46B8-A958-89B63A8A69DE}.Debug|x64.Build.0 = Debug|x64
|
||||
{04B193D7-3E21-46B8-A958-89B63A8A69DE}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{04B193D7-3E21-46B8-A958-89B63A8A69DE}.Debug|x86.Build.0 = Debug|x64
|
||||
{04B193D7-3E21-46B8-A958-89B63A8A69DE}.Release|x64.ActiveCfg = Release|x64
|
||||
{04B193D7-3E21-46B8-A958-89B63A8A69DE}.Release|x64.Build.0 = Release|x64
|
||||
{04B193D7-3E21-46B8-A958-89B63A8A69DE}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{04B193D7-3E21-46B8-A958-89B63A8A69DE}.Release|x86.Build.0 = Release|Any CPU
|
||||
{F44934A8-36F3-49B0-9465-3831BE041CDE}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F44934A8-36F3-49B0-9465-3831BE041CDE}.Debug|x64.Build.0 = Debug|x64
|
||||
{F44934A8-36F3-49B0-9465-3831BE041CDE}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{F44934A8-36F3-49B0-9465-3831BE041CDE}.Release|x64.ActiveCfg = Release|x64
|
||||
{F44934A8-36F3-49B0-9465-3831BE041CDE}.Release|x64.Build.0 = Release|x64
|
||||
{F44934A8-36F3-49B0-9465-3831BE041CDE}.Release|x86.ActiveCfg = Release|x64
|
||||
{F44934A8-36F3-49B0-9465-3831BE041CDE}.Release|x86.Build.0 = Release|x64
|
||||
{5BDBD6C9-A31F-4CEB-871A-5E9E709197EF}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{5BDBD6C9-A31F-4CEB-871A-5E9E709197EF}.Debug|x64.Build.0 = Debug|x64
|
||||
{5BDBD6C9-A31F-4CEB-871A-5E9E709197EF}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{5BDBD6C9-A31F-4CEB-871A-5E9E709197EF}.Release|x64.ActiveCfg = Release|x64
|
||||
{5BDBD6C9-A31F-4CEB-871A-5E9E709197EF}.Release|x64.Build.0 = Release|x64
|
||||
{5BDBD6C9-A31F-4CEB-871A-5E9E709197EF}.Release|x86.ActiveCfg = Release|x64
|
||||
{5BDBD6C9-A31F-4CEB-871A-5E9E709197EF}.Release|x86.Build.0 = Release|x64
|
||||
{FD464B4C-2F68-4D06-91E7-4208146C41F5}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{FD464B4C-2F68-4D06-91E7-4208146C41F5}.Debug|x64.Build.0 = Debug|x64
|
||||
{FD464B4C-2F68-4D06-91E7-4208146C41F5}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{FD464B4C-2F68-4D06-91E7-4208146C41F5}.Debug|x86.Build.0 = Debug|x64
|
||||
{FD464B4C-2F68-4D06-91E7-4208146C41F5}.Release|x64.ActiveCfg = Release|x64
|
||||
{FD464B4C-2F68-4D06-91E7-4208146C41F5}.Release|x64.Build.0 = Release|x64
|
||||
{FD464B4C-2F68-4D06-91E7-4208146C41F5}.Release|x86.ActiveCfg = Release|x64
|
||||
{FD464B4C-2F68-4D06-91E7-4208146C41F5}.Release|x86.Build.0 = Release|x64
|
||||
{8FE5A5EE-1B59-401C-9FB3-B04ECD3E29C1}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{8FE5A5EE-1B59-401C-9FB3-B04ECD3E29C1}.Debug|x64.Build.0 = Debug|x64
|
||||
{8FE5A5EE-1B59-401C-9FB3-B04ECD3E29C1}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{8FE5A5EE-1B59-401C-9FB3-B04ECD3E29C1}.Debug|x86.Build.0 = Debug|x64
|
||||
{8FE5A5EE-1B59-401C-9FB3-B04ECD3E29C1}.Release|x64.ActiveCfg = Release|x64
|
||||
{8FE5A5EE-1B59-401C-9FB3-B04ECD3E29C1}.Release|x64.Build.0 = Release|x64
|
||||
{8FE5A5EE-1B59-401C-9FB3-B04ECD3E29C1}.Release|x86.ActiveCfg = Release|x64
|
||||
{8FE5A5EE-1B59-401C-9FB3-B04ECD3E29C1}.Release|x86.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -1070,7 +1136,6 @@ Global
|
||||
{51920F1F-C28C-4ADF-8660-4238766796C2} = {89E20BCE-EB9C-46C8-8B50-E01A82E6FDC3}
|
||||
{A3935CF4-46C5-4A88-84D3-6B12E16E6BA2} = {89E20BCE-EB9C-46C8-8B50-E01A82E6FDC3}
|
||||
{2151F984-E006-4A9F-92EF-C6DDE3DC8413} = {89E20BCE-EB9C-46C8-8B50-E01A82E6FDC3}
|
||||
{0485F45C-EA7A-4BB5-804B-3E8D14699387} = {89E20BCE-EB9C-46C8-8B50-E01A82E6FDC3}
|
||||
{89F34AF7-1C34-4A72-AA6E-534BCF972BD9} = {38BDB927-829B-4C65-9CD9-93FB05D66D65}
|
||||
{6C7F47CC-2151-44A3-A546-41C70025132C} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC}
|
||||
{2BE46397-4DFA-414C-9BD4-41E4BBF8CB34} = {6C7F47CC-2151-44A3-A546-41C70025132C}
|
||||
@@ -1182,6 +1247,14 @@ Global
|
||||
{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}
|
||||
{F1F6B6B6-9F18-4A17-8B5C-97DF552C53DC} = {2F305555-C296-497E-AC20-5FA1B237996A}
|
||||
{04B193D7-3E21-46B8-A958-89B63A8A69DE} = {2F305555-C296-497E-AC20-5FA1B237996A}
|
||||
{F44934A8-36F3-49B0-9465-3831BE041CDE} = {4AFC9975-2456-4C70-94A4-84073C1CED93}
|
||||
{5BDBD6C9-A31F-4CEB-871A-5E9E709197EF} = {4AFC9975-2456-4C70-94A4-84073C1CED93}
|
||||
{FD464B4C-2F68-4D06-91E7-4208146C41F5} = {4AFC9975-2456-4C70-94A4-84073C1CED93}
|
||||
{8FE5A5EE-1B59-401C-9FB3-B04ECD3E29C1} = {4AFC9975-2456-4C70-94A4-84073C1CED93}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {C3A2F9D1-7930-4EF4-A6FC-7EE0A99821D0}
|
||||
|
||||
184
README.md
184
README.md
@@ -6,10 +6,10 @@
|
||||
|
||||
## Build status
|
||||
|
||||
| Architecture | Solution (Main) | Solution (Stable) | Installer (Main)<br/>Existing pipeline | Installer (Main)<br/>New pipeline |
|
||||
|--------------|-----------------|-------------------|-----------------------|-------------------------------|
|
||||
| x64 | [](https://dev.azure.com/ms/PowerToys/_build/latest?definitionId=219&branchName=main) | [](https://dev.azure.com/ms/PowerToys/_build/latest?definitionId=219&branchName=stable) | [](https://github-private.visualstudio.com/microsoft/_build/latest?definitionId=61&branchName=main) | [](https://dev.azure.com/microsoft/Dart/_build/latest?definitionId=76541&branchName=main) |
|
||||
| ARM64 | Currently investigating | [Issue #490](https://github.com/microsoft/PowerToys/issues/490) | | |
|
||||
| Architecture | Solution (Main) | Solution (Stable) | Installer (Main) |
|
||||
|--------------|-----------------|-------------------|------------------|
|
||||
| x64 | [](https://dev.azure.com/ms/PowerToys/_build/latest?definitionId=219&branchName=main) | [](https://dev.azure.com/ms/PowerToys/_build/latest?definitionId=219&branchName=stable) | [](https://dev.azure.com/microsoft/Dart/_build/latest?definitionId=76541&branchName=main) |
|
||||
| ARM64 | Currently investigating | [Issue #490](https://github.com/microsoft/PowerToys/issues/490) | |
|
||||
|
||||
## About
|
||||
|
||||
@@ -17,21 +17,24 @@ Microsoft PowerToys is a set of utilities for power users to tune and streamline
|
||||
|
||||
| | Current utilities: | |
|
||||
|--------------|--------------------|--------------|
|
||||
| [PowerToys Awake](https://aka.ms/PowerToysOverview_Awake) | [Color Picker](https://aka.ms/PowerToysOverview_ColorPicker) | [FancyZones](https://aka.ms/PowerToysOverview_FancyZones) |
|
||||
| [File Explorer Add-ons](https://aka.ms/PowerToysOverview_FileExplorerAddOns) | [Image Resizer](https://aka.ms/PowerToysOverview_ImageResizer) | [Keyboard Manager](https://aka.ms/PowerToysOverview_KeyboardManager) |
|
||||
| [Mouse utilities](https://aka.ms/PowerToysOverview_MouseUtilities) | [PowerRename](https://aka.ms/PowerToysOverview_PowerRename) | [PowerToys Run](https://aka.ms/PowerToysOverview_PowerToysRun) |
|
||||
| [Shortcut Guide](https://aka.ms/PowerToysOverview_ShortcutGuide) | [Video Conference Mute](https://aka.ms/PowerToysOverview_VideoConference) | |
|
||||
| [Always on Top](https://aka.ms/PowerToysOverview_AoT) | [PowerToys Awake](https://aka.ms/PowerToysOverview_Awake) | [Color Picker](https://aka.ms/PowerToysOverview_ColorPicker) |
|
||||
| [FancyZones](https://aka.ms/PowerToysOverview_FancyZones) | [File Explorer Add-ons](https://aka.ms/PowerToysOverview_FileExplorerAddOns) | [Image Resizer](https://aka.ms/PowerToysOverview_ImageResizer) |
|
||||
| [Keyboard Manager](https://aka.ms/PowerToysOverview_KeyboardManager) | [Mouse utilities](https://aka.ms/PowerToysOverview_MouseUtilities) | [PowerRename](https://aka.ms/PowerToysOverview_PowerRename) |
|
||||
| [PowerToys Run](https://aka.ms/PowerToysOverview_PowerToysRun) | [Shortcut Guide](https://aka.ms/PowerToysOverview_ShortcutGuide) | [Video Conference Mute](https://aka.ms/PowerToysOverview_VideoConference) |
|
||||
|
||||
## Installing and running Microsoft PowerToys
|
||||
|
||||
### Requirements
|
||||
|
||||
- Windows 11 or Windows 10 v1903 (18362) or newer.
|
||||
- [.NET Core 3.1.20 Desktop Runtime](https://dotnet.microsoft.com/download/dotnet/thank-you/runtime-desktop-3.1.20-windows-x64-installer) or a newer 3.1.x runtime. The installer will handle this if not present.
|
||||
- Our installer will install the following items:
|
||||
- [.NET Core 3.1.23 Desktop Runtime](https://dotnet.microsoft.com/download/dotnet/thank-you/runtime-desktop-3.1.23-windows-x64-installer) or a newer 3.1.x runtime. This is needed currently for the Settings application.
|
||||
- [.NET 6.0.3 Desktop Runtime](https://dotnet.microsoft.com/download/dotnet/thank-you/runtime-desktop-6.0.3-windows-x64-installer) or a newer 6.0.x runtime.
|
||||
- [Microsoft Edge WebView2 Runtime](https://go.microsoft.com/fwlink/p/?LinkId=2124703) bootstrapper. This will install the latest version.
|
||||
|
||||
### Via GitHub with EXE [Recommended]
|
||||
|
||||
[Microsoft PowerToys GitHub releases page][github-release-link], click on `Assets` at the bottom to show the files available in the release and then click on `PowerToysSetup-0.51.1-x64.exe` to download the PowerToys installer.
|
||||
[Microsoft PowerToys GitHub releases page][github-release-link], click on `Assets` at the bottom to show the files available in the release and then click on `PowerToysSetup-0.57.0-x64.exe` to download the PowerToys installer.
|
||||
|
||||
This is our preferred method.
|
||||
|
||||
@@ -66,104 +69,117 @@ For guidance on developing for PowerToys, please read the [developer docs](/doc/
|
||||
|
||||
Our [prioritized roadmap][roadmap] of features and utilities that the core team is focusing on.
|
||||
|
||||
### 0.51 - November 2021 Update
|
||||
### 0.57 - March 2022 Update
|
||||
|
||||
The [v0.51 release cycle][github-current-release-work] introduces some new things regarding our mouse utilities. First is we've added in a presentation mode helper to highlight your mouse when you click. We've also added additional settings toward Find my mouse to enable more customization.
|
||||
In this release, we focused heavily on stability and improvements. Below are some of the highlights!
|
||||
|
||||
Next we've been focusing work on "Always on Top" system to help make any window you want to be the top most. A lot of thought is currently going into interaction models to make sure it 'feels' right for toggling as well as visualizing.
|
||||
**Highlights**
|
||||
|
||||
Last, we've been working on our engineering systems this month and into next. This work will improve our localization integration and our 'build farm' match our CI system far more. Behind the scene work but very important work for working faster.
|
||||
- PowerToys Run quality pass. Old standing issues were re-evaluated and fixed.
|
||||
- Additional features and improvements were added to existing PowerToys Run plugins.
|
||||
- New plugin for time and date values/information in PowerToys Run. Thanks [@htcfreek](https://github.com/htcfreek)!
|
||||
- The [PowerToys Run documentation](https://aka.ms/PowerToysOverview_PowerToysRun) is also receiving a required update. Thanks [@htcfreek](https://github.com/htcfreek)!
|
||||
- PowerToys will register SVGs as a picture kind when SVG Thumbnails are enabled so they appear when searching for pictures in File Explorer.
|
||||
- We've disabled PDF preview by default, given its incompatibilities with Outlook and that Edge is now being registered for previewing PDF files on Windows 10 too.
|
||||
- From a coding quality point of view, every project now has code analyzer active. Thanks [@CleanCodeDeveloper](https://github.com/CleanCodeDeveloper)!
|
||||
- A double click on the tray icon is needed instead of single click to open settings.
|
||||
|
||||
#### Highlights from v0.51
|
||||
### Always on Top
|
||||
|
||||
**Things to note**
|
||||
- We shifted our localization internal service and are working on adding automated integrations back in.
|
||||
- New sound for Always on Top activation. Thanks [@franky920920](https://github.com/franky920920)!
|
||||
|
||||
**PowerToys Awake**
|
||||
- System tray and settings use same language for turning things on.
|
||||
### Awake
|
||||
- Fixes for the system tray icon. Thanks [@dend](https://github.com/dend)!
|
||||
- Temporary duration presets are now configurable. Thanks [@dend](https://github.com/dend)!
|
||||
- Fix for an issue causing Awake to not be closed properly. Thanks [@dend](https://github.com/dend)!
|
||||
|
||||
**Color Picker**
|
||||
- New formats added to copy colors as a float or decimal value.
|
||||
- Adjust color window now accepts lower-case HEX codes.
|
||||
### ColorPicker
|
||||
|
||||
**FancyZones**
|
||||
- New window switching functionality! Now users can assign multiple windows to a zone and cycle between them using the <kbd>Win</kbd> + <kbd>PgDn/PgUp</kbd> commands by default. Thanks [@FLOAT4](https://github.com/FLOAT4)!
|
||||
- Added functionality for zones to adopt system accent color and theme. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
|
||||
- Added visual preview of zone appearance in settings menu. Thanks [@niels9001](https://github.com/niels9001)!
|
||||
- Fixed bug where FancyZones crashes on launch.
|
||||
- It's now possible to delete multiple colors from the history, or to export a list of colors to a file. Thanks [@mshtang](https://github.com/mshtang)!
|
||||
- The CIEXYZ format has increased precision. Thanks [@m13253](https://github.com/m13253)!
|
||||
- Performance improved by reducing the use of low level keyboard hooks.
|
||||
|
||||
**Image Resizer**
|
||||
- Fixed bug where resizing images creates empty folders.
|
||||
- Added option to remove non-essential metadata. Helps significantly reduce the size of files. Thanks [@CleanCodeDeveloper](https://github.com/CleanCodeDeveloper)!
|
||||
- Fixed bug caused by Image Resizer receiving an unexpected property type or value. Thanks [@CleanCodeDeveloper](https://github.com/CleanCodeDeveloper)!
|
||||
### FancyZones
|
||||
|
||||
**Mouse utilities**
|
||||
- Find My Mouse: Improved functionality to activate when user double click time configuration is set above 100ms.
|
||||
- Find My Mouse: Fixed display on all virtual desktops as opposed to only the virtual desktop where it was created.
|
||||
- Find My Mouse: New settings to enable a lot more customization based on your feedback.
|
||||
- Minor UI tweaks for fluent icons, appearance, <kbd>Ctrl</kbd> usage, and utility descriptions. Thanks [@niels9001](https://github.com/niels9001)!
|
||||
- New Mouse Highlighter PowerToy! When enabled, activate mouse highlighting with <kbd>Win</kbd> + <kbd>Shift</kbd> + <kbd>H</kbd> by default to begin displaying visual cues on your display when either the left or right mouse buttons are clicked. There is a much more powerful tool called [SysInternal ZoomIt](https://docs.microsoft.com/en-us/sysinternals/downloads/zoomit) that is very helpful as well.
|
||||
- Fixed a bug where the same layout applied with different configurations to different screens would reset to a single configuration. (This was a hotfix for 0.56)
|
||||
- When snapping windows with rounded corners on Windows 11, set the correct corner preferences to avoid gaps between zones. Thanks [@hallatore](https://github.com/hallatore)!
|
||||
- Fix for canvas layout resetting due to resolution changes.
|
||||
|
||||

|
||||
### File explorer
|
||||
|
||||
**PowerRename**
|
||||
- Improved rename performance! This is now at parity (or better) with the prior version based on multiple tests.
|
||||
- Added keyboard accelerators with <kbd>Enter</kbd> and <kbd>Ctrl</kbd> + <kbd>Enter</kbd> to execute rename. Thanks [@niels9001](https://github.com/niels9001)!
|
||||
- UI tweaks to now add number of items selected, grid-lines for improved readability, reduced font sizes & margins, and improved window resizing.
|
||||
- Fixed UI focus issues. Thanks [@niels9001](https://github.com/niels9001)!
|
||||
- Added default window width and height. Thanks [@niels9001](https://github.com/niels9001)!
|
||||
- Added PowerRename event logging for BugReportTool
|
||||
- Additional markdown file extensions added for Markdown Preview. Thanks [@skycommand](https://github.com/skycommand)!
|
||||
- SVG files are now registered as a picture kind on Windows.
|
||||
- Added a text wrapping setting and copy context menu to dev file preview. Thanks [@Aaron-Junker](https://github.com/Aaron-Junker)!
|
||||
- PDF file preview and thumbnails are now disabled by default, due to incompatibility with Outlook and an appropriate warning is shown in Settings.
|
||||
|
||||
**PowerToys Run**
|
||||
- New entries added for settings plugin. Thanks [@htcfreek](https://github.com/htcfreek)!
|
||||
- Added support for application URI handling like `mailto:` and `ms-settings:`. Thanks [@franky920920](https://github.com/franky920920)!
|
||||
- Added DevContainer workspaces to search results of the VSCode Workspaces Plugin. Thanks [@JacobDeuchert](https://github.com/JacobDeuchert)!
|
||||
- Fixes for crashing issues.
|
||||
### Mouse utility
|
||||
|
||||
**Shortcut Guide**
|
||||
- Added rounded corners to keys and tooltips, and system accent colors for desktop backdrop. Thanks [@niels9001](https://github.com/niels9001)!
|
||||
- Find my mouse has a new setting to specify a minimum moving distance for activation. (This was a hotfix for 0.56)
|
||||
- Fix for the bug causing the task bar to be hidden behind other windows when a mouse utility was active.
|
||||
- Fix for the bug causing shortcuts set on icons to not activate when a mouse utility was active.
|
||||
- Fixed a slight offset in Mouse Pointer Crosshairs when it's configured with an odd thickness.
|
||||
|
||||
**Settings**
|
||||
- Fixed default settings window size to prevent it from opening offscreen. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
|
||||
### PowerToys Run
|
||||
|
||||
**Video Conference Mute**
|
||||
- Minor UI tweaks for icon, clear button, and overlay image selection [#14248](https://github.com/microsoft/PowerToys/issues/14248). Thanks [@niels9001](https://github.com/niels9001)!
|
||||
- New plugin for time and date values/information. Thanks [@htcfreek](https://github.com/htcfreek)!
|
||||
- WindowWalker now has a tooltip, additional features like killing the process and closing the window, additional settings and improvements. Thanks [@htcfreek](https://github.com/htcfreek)!
|
||||
- Unit converter now accepts alternative syntax for feet and gallon. It interprets as either imperial or US gallons depending on current culture. Thanks [@yifan-k](https://github.com/yifan-k)!
|
||||
- Unit converter now accepts "metre" and "meter".
|
||||
- Localization for Web Search and Unit Converter (not including units) has been enabled.
|
||||
- Localization for Windows Terminal has been enabled. (This was a hotfix for 0.56)
|
||||
- Calculator now tries to always interpret the dot (.) symbol as a decimal separator, despite configured culture, to meet expectations.
|
||||
- Calculator now handles trailing zeroes on hexadecimal numbers correctly.
|
||||
- System commands plugin can now show the local ip and mac addresses. Thanks [@htcfreek](https://github.com/htcfreek)!
|
||||
- Folder plugin has improved results, with improved tooltips. Thanks [@htcfreek](https://github.com/htcfreek)!
|
||||
- Windows settings plugin has added entries for Screen Saver and Connect Wiring Display Panel. Thanks [@htcfreek](https://github.com/htcfreek)!
|
||||
- Plugins can now show descriptions for their configurations in settings. Thanks [@htcfreek](https://github.com/htcfreek)!
|
||||
- Fix for the focus issue when calling PowerToys Run for the first time after login and after returning from some windows.
|
||||
- Fix for a bug on Program when creating a shortcut.
|
||||
- Validated that upgrading to .NET framework 6 fixed the error appearing when shutting down the system with PowerToys Run running.
|
||||
|
||||
**Prototype work**
|
||||
- Always on top prototype of being actively worked on. Right now you hit a key-combo and it enables it. We are investigating ways to highlight the window in some form as well.
|
||||
### Video conference mute
|
||||
|
||||
**Installer**
|
||||
- Investigated how to fully shift to WIX bootstrapper and remove custom boot strapper
|
||||
- Investigated how to fully shift to HKCU vs HKLM.
|
||||
- Newly added microphones are now updated and tracked by VCM.
|
||||
|
||||
**Random helping out**
|
||||
- Spell check fix - Thanks [@franky920920](https://github.com/franky920920)!
|
||||
- Fix a URL - Thanks [@JeffersonQin](https://github.com/JeffersonQin)!
|
||||
### Settings
|
||||
|
||||
**Development relevant**
|
||||
- Focusing on cleaning up backlog of issues and developing a method to aid in prioritizing. [@Dend](https://github.com/dend) and [@crutkas](https://github.com/crutkas) are partnering to see if we can develop one signal to see what we are calling ['centers of gravity'](https://gravity-issues.netlify.app/).
|
||||
- Our primary dev branch is now named `Main`.
|
||||
- Adjusting plugin folder structure for PT Run [#10796](https://github.com/microsoft/PowerToys/issues/10796)
|
||||
- Working on shifting our release pipeline onto same system that Windows Terminal uses.
|
||||
- Improvements to environment variable usage/update process in PT Run. Thanks [@htcfreek](https://github.com/htcfreek)!
|
||||
- Update .NET to 3.1.20.
|
||||
- Centralized process list in the BugReportTool.
|
||||
- Registry handling improvement for MSI and File Explorer add-ons.
|
||||
- _What's new_ button in the bottom with a new look, with a few more UI tweaks. Thanks [@niels9001](https://github.com/niels9001)!
|
||||
- Fixed a bug causing Settings not to open when a racing condition caused Keyboard Manager settings to not be read correctly.
|
||||
- To open settings from the tray icon a double click is needed instead of a single click.
|
||||
- Fix for a bug which would cause checking for updates to run indefinitely.
|
||||
- When auto-updating, pass a flag to avoid rebooting the computer without being prompted.
|
||||
|
||||
**Community contributions**
|
||||
### Installer
|
||||
|
||||
We'd like to directly mention certain contributors (in alphabetical order) for their continued community support this month and helping directly make PowerToys a better piece of software.
|
||||
- Dependencies installers are now executed with /norestart to avoid unprompted reboots. (This was a hotfix for 0.56). Thanks [@franky920920](https://github.com/franky920920)!
|
||||
- Upgraded .NET framework dependency to 6.0.3.
|
||||
- Installer logs are now saved where they can be collected and sent by the bug report tool.
|
||||
- Reverted changes to start with proper elevation and when installed under a different user since those changes ended up causing more issues where PowerToys would start running with the wrong user.
|
||||
|
||||
[@AnonymousWP](https://github.com/AnonymousWP), [@Aaron-Junker](https://github.com/Aaron-Junker), [@CleanCodeDeveloper](https://github.com/CleanCodeDeveloper), [@davidegiacometti](https://github.com/davidegiacometti), [@FLOAT4](https://github.com/FLOAT4), [@franky920920](https://github.com/franky920920), [@htcfreek](https://github.com/htcfreek), [@JacobDeuchert](https://github.com/JacobDeuchert), [@Jay-o-Way](https://github.com/jay-o-way) [@JeffersonQin](https://github.com/JeffersonQin), [@niels9001](https://github.com/niels9001), and [@rdeveen](https://github.com/rdeveen).
|
||||
### Development
|
||||
|
||||
#### What is being planned for v0.53
|
||||
- OOBE code refactor to have all module information in XAML, like in Settings. Thanks [@niels9001](https://github.com/niels9001)!
|
||||
- Every project now has analyzers turned on and warnings fixed. Thanks [@CleanCodeDeveloper](https://github.com/CleanCodeDeveloper)!
|
||||
- New patterns added for code spell-checking and stale entries removed. Thanks [@jsoref](https://github.com/jsoref)
|
||||
- Additional logging has been added to Fancy Zones and PowerToys Run.
|
||||
- A new CI release build will not be triggered if all that was changed was just documentation.
|
||||
- Fixed a racing condition causing flaky build errors when building PowerRename.
|
||||
- Centralization of common csproj/vcxproj settings underway. Thanks [@CleanCodeDeveloper](https://github.com/CleanCodeDeveloper)!
|
||||
|
||||
For [v0.53][github-next-release-work], due to holidays, we'll be in a maintenance sprint but here are some of the larger items:
|
||||
#### Community contributions
|
||||
|
||||
- Hope to add Always on Top into PowerToys. We currently have a proof of concept ready.
|
||||
- We are working to heavily reduce / remove the UAC prompt over the next few releases on install. This is a big shift so it is spanning multiple releases so we can isolate issues if they do occur. Work is tracked in [#10126](https://github.com/microsoft/PowerToys/issues/10126)
|
||||
- Update the PowerToys Build Pipeline to allow .NET 6 integration
|
||||
- Engineering Systems/Stability/Bug fixes
|
||||
We'd like to directly mention certain contributors (in alphabetical order) for their continued community support this month and helping directly make PowerToys a better piece of software.
|
||||
[@Aaron-Junker](https://github.com/Aaron-Junker), [@CleanCodeDeveloper](https://github.com/CleanCodeDeveloper), [@dend](https://github.com/dend), [@franky920920](https://github.com/franky920920), [@htcfreek](https://github.com/htcfreek), [@jay-o-way](https://github.com/jay-o-way), [@jsoref](https://github.com/jsoref), [@niels9001](https://github.com/niels9001), [@snickler](https://github.com/snickler).
|
||||
|
||||
|
||||
#### What is being planned for v0.58
|
||||
|
||||
For [v0.58][github-next-release-work], we'll start work on below:
|
||||
|
||||
- Environment Variables Editor PowerToy
|
||||
- Continue work on another new PowerToy
|
||||
- Stability / bug fixes
|
||||
- Adding new file types to dev file preview
|
||||
|
||||
## PowerToys Community
|
||||
|
||||
@@ -190,5 +206,5 @@ The application logs basic telemetry. Our Telemetry Data page (Coming Soon) has
|
||||
[usingPowerToys-docs-link]: https://aka.ms/powertoys-docs
|
||||
|
||||
<!-- items that need to be updated release to release -->
|
||||
[github-next-release-work]: https://github.com/microsoft/PowerToys/issues?q=is%3Aopen+is%3Aissue+project%3Amicrosoft%2FPowerToys%2F27
|
||||
[github-current-release-work]: https://github.com/microsoft/PowerToys/issues?q=is%3Aopen+is%3Aissue+project%3Amicrosoft%2FPowerToys%2F26
|
||||
[github-next-release-work]: https://github.com/microsoft/PowerToys/issues?q=is%3Aopen+is%3Aissue+project%3Amicrosoft%2FPowerToys%2F31
|
||||
[github-current-release-work]: https://github.com/microsoft/PowerToys/issues?q=is%3Aopen+is%3Aissue+project%3Amicrosoft%2FPowerToys%2F30
|
||||
|
||||
@@ -78,7 +78,7 @@ The plugin use only these interfaces (all inside the `Main.cs`):
|
||||
|
||||
| Name | Value |
|
||||
| --------------- | ------------------------------------------------------------------------------ |
|
||||
| TargetFramework | `netcoreapp3.1` (means .NET Core 3.1) |
|
||||
| TargetFramework | `net6.0-windows` (.NET 5) or `net6.0-windows10.0.18362.0` (OS version specific)|
|
||||
| LangVersion | `8.0` (mean C# 8.0) |
|
||||
| Platforms | `x64` |
|
||||
| Nullable | `true` |
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
# Sys Plugin
|
||||
|
||||
As the name suggests, the Sys Plugin is used to directly run Windows system commands that have been entered by the user as a query. This is done by parsing the entry and validating the command, followed by executing it.
|
||||
|
||||
* Shutdown
|
||||
* Restart
|
||||
* Sign Out
|
||||
* Lock
|
||||
* Sleep
|
||||
* Hibernate
|
||||
* Empty Recycle Bin
|
||||
|
||||

|
||||
|
||||
## [`Sys`](/src/modules/launcher/Plugins/Microsoft.Plugin.Sys/Main.cs)
|
||||
|
||||
* Tries to parse the user input and returns a specific Windows system command by using a [`Result`](/src/modules/launcher/Wox.Plugin/Result.cs) list.
|
||||
|
||||
* While parsing, the Sys plugin uses [`FuzzyMatch`](/src/modules/launcher/Wox.Infrastructure/StringMatcher.cs) to get characters matching a result in the list.
|
||||
|
||||
### Score
|
||||
|
||||
* [`CalculateSearchScore`](/src/modules/launcher/Wox.Infrastructure/StringMatcher.cs) A match found near the beginning of a string is scored more than a match found near the end. A match is scored more if the characters in the patterns are closer to each other, while the score is lower if they are more spread out.
|
||||
84
doc/devdocs/modules/launcher/plugins/system.md
Normal file
84
doc/devdocs/modules/launcher/plugins/system.md
Normal file
@@ -0,0 +1,84 @@
|
||||
# Windows System Commands Plugin
|
||||
|
||||
As the name suggests, the Windows System Commands Plugin is used to directly run Windows system commands that have been entered by the user as a query. This is done by parsing the entry and validating the command, followed by executing it.
|
||||
|
||||
The user can change the behavior of the plugin (language, confirmation dialog, ...) with optional plugin settings.
|
||||
|
||||

|
||||
|
||||
Available commands:
|
||||
* Shutdown
|
||||
* Restart
|
||||
* Sign Out
|
||||
* Lock
|
||||
* Sleep
|
||||
* Hibernate
|
||||
* Empty Recycle Bin
|
||||
* UEFI Firmware Settings (Only available on systems, that boot in UEFI mode.)
|
||||
* IP / MAC / Address => Show informations about network connections.
|
||||
|
||||
## Optional plugin settings
|
||||
|
||||
* We have the following settings that the user can configure to change the behavior of the plugin:
|
||||
|
||||
| Key | Default value | Name/Description |
|
||||
|--------------|-----------|------------|
|
||||
| `ConfirmSystemCommands` | `false` | Show a dialog to confirm system commands |
|
||||
| `LocalizeSystemCommands` | `true` | Use localized system commands instead of English ones |
|
||||
| `ReduceNetworkResultScore` | `true` | Reduce the priority of 'IP' and 'MAC' results to improve the order in the global results |
|
||||
|
||||
* The optional plugin settings are implemented via the [`ISettingProvider`](/src/modules/launcher/Wox.Plugin/ISettingProvider.cs) interface from `Wox.Plugin` project. All available settings for the plugin are defined in the [`Main`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.System/Main.cs) class of the plugin.
|
||||
|
||||
## Technical details
|
||||
|
||||
### [`Main`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.System/Main.cs)
|
||||
|
||||
* Tries to parse the user input and returns a specific Windows system command by using a [`Result`](/src/modules/launcher/Wox.Plugin/Result.cs) list.
|
||||
|
||||
* While parsing, the plugin uses [`FuzzyMatch`](/src/modules/launcher/Wox.Infrastructure/StringMatcher.cs) to get characters matching a result in the list.
|
||||
|
||||
### [`Commands.cs`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.System/Components/Commands.cs)
|
||||
- The [`Commands`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.System/Components/Commands.cs) class contains the definition of all available commands/results.
|
||||
|
||||
### [`ResultHelper.cs`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.System/Components/ResultHelper.cs)
|
||||
- The [`ResultHelper`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.System/Components/ResultHelper.cs) class contains methods for working with the results and some of the result features (tool tip, copy to clipboard, execute command).
|
||||
|
||||
### [`NetworkConnectionProperties.cs`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.System/Components/NetworkConnectionProperties.cs)
|
||||
- The [`NetworkConnectionProperties`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.System/Components/NetworkConnectionProperties.cs) class contains methods to get the properties of a network interface/connection.
|
||||
- An instance of this class collects/provides all required informations about one connection/adapter.
|
||||
|
||||
### [`SystemPluginContext.cs`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.System/Components/SystemPluginContext.cs)
|
||||
- An instance of the class [`SystemPluginContext`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.System/Components/SystemPluginContext.cs) contains/defines the context data of a system plugin result. We select the context menu based on the defined properties.
|
||||
- It is used for the `ContextData` property of the [`Wox.Plugin.Result`](/src/modules/launcher/Wox.Plugin/Result.cs).
|
||||
|
||||
|
||||
### UEFI command
|
||||
|
||||
* The UEFI command is only available on systems, that boot in UEFI mode.
|
||||
|
||||
* This is validated by checking the result of the method [`GetSystemFirmwareType`](/src/modules/launcher/Wox.Plugin/Common/Win32/Win32Helpers.cs), which uses the native method [`GetFirmwareType`](/src/modules/launcher/Wox.Plugin/Common/Win32/NativeMethods.cs) in `kernel32.dll`.
|
||||
|
||||
## Search
|
||||
|
||||
### Score
|
||||
|
||||
* [`CalculateSearchScore`](/src/modules/launcher/Wox.Infrastructure/StringMatcher.cs) A match found near the beginning of a string is scored more than a match found near the end. A match is scored more if the characters in the patterns are closer to each other, while the score is lower if they are more spread out.
|
||||
* For network results (IP address and MAC address) the score is reduced by 25 percent.
|
||||
|
||||
### Network results on global queries
|
||||
- The network results (IP and MAC address) are only shown on global queries, if the search term starts with either IP, MAC or Address. (We compare case-insensitive.)
|
||||
|
||||
### Returning results
|
||||
We return the results in two steps:
|
||||
1. All results which we can create very fast like shutdown or logoff via [`Main.Query(Query query)`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.System/Main.cs).
|
||||
2. All results which need some time to create like the network results (IP, MAC) via [`Main.Query(Query query, bool delayedExecution)`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.System/Main.cs).
|
||||
|
||||
## [Unit Tests](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.System.UnitTests)
|
||||
We have a [Unit Test project](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.System.UnitTests) that executes various test to ensure that the plugin works as expected.
|
||||
|
||||
### [`ImageTests.cs`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.System.UnitTests/ImageTests.cs)
|
||||
- The [`ImageTests.cs`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.System.UnitTests/ImageTests.cs) class contains tests to validate that each result shows the expected and correct image.
|
||||
|
||||
### [`QueryTests.cs`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.System.UnitTests/QueryTests.cs)
|
||||
- The [`QueryTests.cs`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.System.UnitTests/QueryTests.cs) class contains tests to validate that the user gets the correct results when searching.
|
||||
|
||||
150
doc/devdocs/modules/launcher/plugins/timeZone.md
Normal file
150
doc/devdocs/modules/launcher/plugins/timeZone.md
Normal file
@@ -0,0 +1,150 @@
|
||||
# Time Zone Plugin
|
||||
|
||||
The Time Zone plugin allows users to search a time zone.
|
||||
|
||||
## Special functions (differ from the regular functions)
|
||||
|
||||
* Search for a country, like Kamchatka, Prince Edward Island, France
|
||||
* Search for a shortcuts, like WEST, UTC, PST
|
||||
* Search for a offset, like -12:00, -7, 5, 9:30
|
||||
* Search for a military time zone name (must activate in plugin settings)
|
||||
|
||||
## How to add a new time zone or change one
|
||||
|
||||
All time zones are located in `TimeZone.json` in root folder of the project.
|
||||
The `TimeZone.json` use a JSON schema file that make it easier to edit it.
|
||||
|
||||
| Key | Optional | Value type |
|
||||
| ------------------- | -------- | ----------------- |
|
||||
| `Offset` | **No** | String |
|
||||
| `Name` | Yes | String |
|
||||
| `MilitaryName` | Yes | String |
|
||||
| `Shortcut` | Yes | String |
|
||||
| `TimeNamesStandard` | Yes | List with strings |
|
||||
| `TimeNamesDaylight` | Yes | List with strings |
|
||||
| `ShortcutsStandard` | Yes | List with strings |
|
||||
| `ShortcutsDaylight` | Yes | List with strings |
|
||||
| `CountriesStandard` | Yes | List with strings |
|
||||
| `CountriesDaylight` | Yes | List with strings |
|
||||
|
||||
A minimum entry for the `TimeZone.json` looks like:
|
||||
|
||||
```json
|
||||
{
|
||||
"Offset": "11:55",
|
||||
"Name": "My crazy time zone",
|
||||
}
|
||||
```
|
||||
|
||||
A full entry for the `TimeZone.json` looks like:
|
||||
|
||||
```json
|
||||
{
|
||||
"Offset": "11:55",
|
||||
"Name": "My crazy time zone",
|
||||
"Shortcut" : "MYTZ",
|
||||
"MilitaryName" : "Order Time Zone",
|
||||
"TimeNamesStandard": [
|
||||
"My crazy standard time"
|
||||
],
|
||||
"ShortcutsStandard": [
|
||||
"MCST"
|
||||
],
|
||||
"TimeNamesDaylight": [
|
||||
"My crazy daylight time"
|
||||
],
|
||||
"ShortcutsDaylight": [
|
||||
"MCDT"
|
||||
],
|
||||
"CountriesStandard": [
|
||||
"Crazy Land East"
|
||||
],
|
||||
"CountriesDaylight": [
|
||||
"Crazy Land West"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Remarks
|
||||
|
||||
* At minimum one of the optional value should be filled.
|
||||
|
||||
## Scores
|
||||
|
||||
* Scores are not used
|
||||
|
||||
## Important for developers
|
||||
|
||||
### General
|
||||
|
||||
* The assembly name is cached into `_assemblyName` (to avoid to many calls of `Assembly.GetExecutingAssembly()`)
|
||||
|
||||
## Microsoft.PowerToys.Run.Plugin.TimeZone project
|
||||
|
||||
### Important plugin values (meta-data)
|
||||
|
||||
| Name | Value |
|
||||
| --------------- | ---------------------------------------------------- |
|
||||
| ActionKeyword | `&` |
|
||||
| ExecuteFileName | `Microsoft.PowerToys.Run.Plugin.TimeZone.dll` |
|
||||
| ID | `BADD1B06EF0A4B61AD95395F24241D69` |
|
||||
|
||||
### Interfaces used by this plugin
|
||||
|
||||
The plugin use only these interfaces (all inside the `Main.cs`):
|
||||
|
||||
* `Wox.Plugin.IPlugin`
|
||||
* `Wox.Plugin.IContextMenu`
|
||||
* `Wox.Plugin.IPluginI18n`
|
||||
* `Wox.Plugin.ISettingProvider`
|
||||
* `IDisposable`
|
||||
|
||||
### Program files
|
||||
|
||||
| File | Content |
|
||||
| -------------------------------------- | ----------------------------------------------------------------------- |
|
||||
| `Classes\TimeZoneProperties.cs` | A class that represent one time zone |
|
||||
| `Classes\TimeZones.cs` | A wrapper class that only contains a list with time zones (see 1) |
|
||||
| `Classes\TimeZoneSettings.cs` | A class that contains all settings for the Time Zone plugin |
|
||||
| `Extensions\StringBuilderExtension.cs` | Extension methods for `StringBuilder` Objects |
|
||||
| `Helper\ContextMenuHelper.cs` | All functions to build the context menu (for each result entry) |
|
||||
| `Helper\JsonHelper.cs` | All functions to load the time zones from a JSON file |
|
||||
| `Helper\ResultHelper.cs` | All functions to convert internal results into WOX results |
|
||||
| `Helper\TranslationHelper.cs` | All functions to translate the result in the surface language |
|
||||
| `Images\timeZone.dark.png` | Symbol for the results for the dark theme |
|
||||
| `Images\timeZone.light.png` | Symbol for the results for the light theme |
|
||||
| `Properties\Resources.Designer.resx` | File that contain all translatable keys |
|
||||
| `Properties\Resources.resx` | File that contain all translatable strings in the neutral language |
|
||||
| `GlobalSuppressions.cs` | Code suppressions (no real file, linked via *.csproj) |
|
||||
| `Main.cs` | Main class, the only place that implement the WOX interfaces |
|
||||
| `plugin.json` | All meta-data for this plugin |
|
||||
| `StyleCop.json` | Code style (no real file, linked via *.csproj) |
|
||||
| `timezones.json` | File that contains all time zone information |
|
||||
| `timeZones.schema.json` | JSON schema for `timezones.json` |
|
||||
| `StyleCop.json` | Code style (no real file, linked via *.csproj) |
|
||||
|
||||
1. We need this extra wrapper class to make it possible that the JSON file can have and use a JSON schema file.
|
||||
Because the JSON file must have a object as root type, instead of a array.
|
||||
|
||||
### Important project values (*.csproj)
|
||||
|
||||
| Name | Value |
|
||||
| --------------- | ------------------------------------------------------------- |
|
||||
| TargetFramework | `net6.0-windows` |
|
||||
| Platforms | `x64` |
|
||||
| Output | `..\..\..\..\..\x64\Debug\modules\launcher\Plugins\TimeZone\` |
|
||||
| RootNamespace | `Microsoft.PowerToys.Run.Plugin.TimeZone` |
|
||||
| AssemblyName | `Microsoft.PowerToys.Run.Plugin.TimeZone` |
|
||||
|
||||
### Project dependencies
|
||||
|
||||
#### Packages
|
||||
|
||||
| Package | Version |
|
||||
| ------------------------------------------------------------------------------------- | ------- |
|
||||
| [`StyleCop.Analyzers`](https://github.com/DotNetAnalyzers/StyleCopAnalyzers) | 1.1.118 |
|
||||
|
||||
#### Projects
|
||||
|
||||
* `Wox.Infrastructure`
|
||||
* `Wox.Plugin`
|
||||
148
doc/devdocs/modules/launcher/plugins/timedate.md
Normal file
148
doc/devdocs/modules/launcher/plugins/timedate.md
Normal file
@@ -0,0 +1,148 @@
|
||||
# 'Time and Date' plugin
|
||||
The 'Time and Date' plugin shows the date and time in different formats. For the date and time formats the plugin uses the culture setting in Windows, if the format is not commonly defined. The user can search for the system date/time or a custom date/time. The value of each result can be copied to clipboard.
|
||||
|
||||
**Query examples:**
|
||||
- Format: `time`
|
||||
- Date/time: `10:30 AM`
|
||||
- Format and date/time: `Week number::10/10/2022`
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
|
||||
## Formats
|
||||
|
||||
### Available formats
|
||||
|
||||
**Remarks**
|
||||
- The following formats requires a prefix in the query:
|
||||
- Unix Timestamp: `u`
|
||||
- Windows file time: `ft`
|
||||
- On invalid number inputs we show a warning that tells the user which prefixes are allowed/required.
|
||||
|
||||
**List of available formats**
|
||||
|
||||
The following formats are currently available:
|
||||
|
||||
| Format | Example (Based on default settings) | As result | As input |
|
||||
|--------------|-----------|------------|------------|
|
||||
| Time | 5:10 PM | x | x |
|
||||
| Date | 3/5/2022 | x | x |
|
||||
| Now | 3/5/2022 5:10 PM | x | x |
|
||||
| Time UTC | 4:10 PM | x | x |
|
||||
| Now UTC | 3/5/2022 4:10 PM | x | x |
|
||||
| Unix Timestamp | 1646496622 | x | x |
|
||||
| Hour | 10 | x | |
|
||||
| Minute | 30 | x | |
|
||||
| Second | 45 | x | |
|
||||
| Millisecond | 678 | x | |
|
||||
| Day (Week day) | Saturday | x | |
|
||||
| Day of the week | 6 | x | |
|
||||
| Day of the month | 5 | x | |
|
||||
| Day of the year | 64 | x | |
|
||||
| Week of the month | 1 | x | |
|
||||
| Week of the year (Calendar week, Week number) | 10 | x | |
|
||||
| Month | March | x | |
|
||||
| Month of the year | 3 | x | |
|
||||
| Month and day | March 7 | x | x |
|
||||
| Year | 2022 | x | |
|
||||
| Era | AD | x | |
|
||||
| Era abbreviation | A | x | |
|
||||
| Month and year | March 2022 | x | x |
|
||||
| Windows file time (Int64 number) | 637820976123938199 | x | x |
|
||||
| Universal time format: YYYY-MM-DD hh:mm:ss| 2022-03-05 16:20:12Z | x | x |
|
||||
| ISO 8601 | 2022-03-05T17:23:04 | x | x |
|
||||
| ISO 8601 UTC | 2022-03-05T16:23:04 | x | x |
|
||||
| ISO 8601 with time zone | 2022-03-05T17:23:04+01:00 | x | x |
|
||||
| ISO 8601 UTC with time zone | 2022-03-05T16:23:04Z | x | x |
|
||||
| RFC1123 | Sat, 05 Mar 2022 16:23:04 GMT | x | x |
|
||||
|
||||
### Add new formats
|
||||
- To add a new formats you have to add them to the method `GetList()` of the [`AvailableResultsList`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Components/AvailableResultsList.cs) class.
|
||||
- Please add the new formats in the second range. The first one is reserved for the three main formats (Time, Date, Now).
|
||||
- After adding the new formats you have to update the Unit Tests!
|
||||
|
||||
|
||||
## Optional plugin settings
|
||||
- The optional plugin settings are implemented via the [`ISettingProvider`](/src/modules/launcher/Wox.Plugin/ISettingProvider.cs) interface from `Wox.Plugin` project.
|
||||
- All available settings for the plugin are defined in the [`TimeDateSettings`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Components/TimeDateSettings.cs) class of the plugin. The settings can be accessed everywhere in the plugin code via the static class instance `TimeDateSettings.Instance`.
|
||||
- We have the following settings that the user can configure to change the behavior of the plugin:
|
||||
|
||||
| Key | Default value | Name/Description |
|
||||
|--------------|-----------|------------|
|
||||
| `OnlyDateTimeNowGlobal` | `true` | Show only 'Time', 'Date', and 'Now' result on global queries |
|
||||
| `TimeWithSeconds` | `false` | Show time with seconds (Applies to 'Time' and 'Now' result) |
|
||||
| `DateWithWeekday` | `false` | Show date with weekday and name of month (Applies to 'Date' and 'Now' result) |
|
||||
| `HideNumberMessageOnGlobalQuery` | `false` | Hide 'Invalid number input' error message on global queries |
|
||||
|
||||
|
||||
## Classes
|
||||
|
||||
### [`AvailableResult.cs`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Components/AvailableResult.cs)
|
||||
- Each instance of the [`AvailableResult`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Components/AvailableResult.cs) class represents a time/date result/format that the user can search for.
|
||||
- The results/formats are defined in the `AvailableResultsList` class.
|
||||
|
||||
### [`AvailableResultsList.cs`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Components/AvailableResultsList.cs)
|
||||
- The [`AvailableResultsList`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Components/AvailableResultsList.cs) class contains the list of available formats/results in its method `GetList()`.
|
||||
|
||||
### [`ResultHelper.cs`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Components/ResultHelper.cs)
|
||||
- The [`ResultHelper`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Components/ResultHelper.cs) class contains methods for some of the result features (tool tip, copy to clipboard) and the error result on incorrect number input.
|
||||
- And it contains the `SelectStringFromResources()` method for getting the resource strings based on the user input.
|
||||
- The method has a parameter for the `stringId` which is the name of the string in the resource file. By default the word `Now` is automatically added at the end to get the string for a system time/date search.
|
||||
- If a different/custom string is needed for a system time/date search the parameter `stringIdNow` can be used to override the default behavior of the method.
|
||||
- If only a string for the system time/date search is required, you can set `stringId` to `string.Empty` and only `stringIdNow` to a valid string id.
|
||||
|
||||
### [`TimeAndDateHelper.cs`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Components/TimeAndDateHelper.cs)
|
||||
- The [`TimeAndDateHelper`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Components/TimeAndDateHelper.cs) class contains methods to format/convert date and time formats/strings.
|
||||
|
||||
### [`TimeDateSettings.cs`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Components/TimeDateSettings.cs)
|
||||
- The [`TimeDateSettings`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Components/TimeDateSettings.cs) class provides access to all optional plugin settings.
|
||||
- The class has a static property called `Instance` that holds an instance of the class itself. This allows us to access the settings from everywhere in the plugin code without having additional parameters in our methods.
|
||||
|
||||
### [`SearchController.cs`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Components/SearchController.cs)
|
||||
- The [`SearchController`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate/Components/SearchController.cs) encapsulates the methods needed to search and find matches.
|
||||
|
||||
|
||||
## Search
|
||||
|
||||
### Tags
|
||||
- We compare the user input with the label of each results. If it doesn't match we search the tags of the result too.
|
||||
- For each result two tag strings are defined. One for a search with system time/date and one for a search with a custom time/date. Most of the results (except the era results) are using one of the generic tag lists: Date, Time or Format
|
||||
- The selection of the tag (for "system time/date" or "custom time/date") is happening at search time in the `AvailableResultsList.cs` class.
|
||||
- The different tags in a list are split by the `;` character.
|
||||
|
||||
### Score
|
||||
- The plugin uses `FuzzyMatching` to get the matching formats, if the user searches for a specific format. The score is set based on the `FuzzySearch` result.
|
||||
- To achieve a better balance between sub title matches and tag matches the score of tag matches is divided by two.
|
||||
|
||||
### Match requirements for global queries
|
||||
On global queries the high score returned by `FuzzySearch` has negative impacts on the user experience and the search results priority/order of other plugins. To mitigate this we defined some matching requirements:
|
||||
- If the query is a word of the following conjunction list, we don't return any results: for, and, nor, but, or, so
|
||||
- We don't have 'yet' (synonym of 'now') on the list, because this could block results in some languages.
|
||||
- The first word of the query has to be a full match with a word in the label or tag list.
|
||||
- For both requirements we compare case-insensitive.
|
||||
|
||||
|
||||
## [Unit Tests](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests)
|
||||
We have a [Unit Test project](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests) that executes various test to ensure that the plugin works as expected.
|
||||
|
||||
### [`TimeDateResultTests.cs`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests/TimeDateResultTests.cs)
|
||||
- The [`TimeDateResultTests.cs`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests/TimeDateResultTests.cs) class contains tests to validate that the time and date values are correctly formatted/calculated.
|
||||
- That we can execute the tests at any time on any machine, we use a specified date/time value and set the thread culture always to `en-us` while executing the tests.
|
||||
- Some tests contain checks that calculate the expected result at runtime instead of using an expected value written fix in the code. This is done to get valid results on every machine at any time.
|
||||
|
||||
### [`ImageTests.cs`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests/ImageTests.cs)
|
||||
- The [`ImageTests.cs`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests/ImageTests.cs) class contains tests to validate that each result shows the expected and correct image.
|
||||
- That we can execute the tests at any time on any machine, we set the thread culture always to `en-us` while executing the tests.
|
||||
|
||||
### [`PluginSettingsTests.cs`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests/PluginSettingsTests.cs)
|
||||
- The [`PluginSettingsTests.cs`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests/PluginSettingsTests.cs) class contains tests to validate that all settings exist and that they have the correct default values.
|
||||
|
||||
### [`QueryTests.cs`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests/QueryTests.cs)
|
||||
- The [`QueryTests.cs`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests/QueryTests.cs) class contains tests to validate that the user gets the correct results when searching.,
|
||||
- That we can execute the tests at any time on any machine, we set the thread culture always to `en-us` while executing the tests.
|
||||
|
||||
### [`StringParserTests.cs`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests/StringParserTests.cs)
|
||||
- The [`StringParserTests.cs`](/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests/StringParserTests.cs) class contains tests to validate that the typed string gets converted correctly into a `DateTime` object.
|
||||
- That we can execute the tests at any time on any machine, we set the thread culture always to `en-us` while executing the tests.
|
||||
@@ -141,7 +141,7 @@ Because the JSON file must have a object as root type, instead of a array.
|
||||
|
||||
| Name | Value |
|
||||
| --------------- | --------------------------------------------------------------------------------------------------- |
|
||||
| TargetFramework | `netcoreapp3.1` (means .NET Core 3.1) |
|
||||
| TargetFramework | `net6.0-windows` (.NET 5) or `net6.0-windows10.0.18362.0` (OS version specific) |
|
||||
| Platforms | `x64` |
|
||||
| Output | `..\..\..\..\..\x64\Debug\modules\launcher\Plugins\Microsoft.PowerToys.Run.Plugin.WindowsSettings\` |
|
||||
| RootNamespace | `Microsoft.PowerToys.Run.Plugin.WindowsSettings` |
|
||||
|
||||
@@ -1,18 +1,84 @@
|
||||
# Window Walker plugin
|
||||
The window walker plugin matches the user entered query with the open windows on the system.
|
||||
The user can switch to the found windows, close them or kill their process.
|
||||
|
||||

|
||||
|
||||
### [`OpenWindows.cs`](src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/OpenWindows.cs)
|
||||
- The window walker plugin uses the `EnumWindows` function to enumerate all the open windows in the [`OpenWindows.cs`](src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/OpenWindows.cs) class.
|
||||
|
||||
## Remarks
|
||||
|
||||
### UWP Apps
|
||||
- The process of an UWP app can't be detected correctly for windows that are minimized while searching. At this time they are assigned to the generic process `ApplicationFrameHost.exe`. If the user searches for such an window while it is not minimized, then the process gets assigned correctly/updated.
|
||||
|
||||
### Killing processes
|
||||
- Killing the Explorer process is only allowed, if each folder window is running in its own process. (See section `File Explorer setting` below.)
|
||||
- You can only kill elevated processes, if you have admin permissions (UAC).
|
||||
- If you kill the process of an UWP app window, you kill all instances of the app. All windows are assigned to the same process.
|
||||
- Windows of UWP apps don't know their process, until they are searched in non-minimized state.
|
||||
|
||||
### File Explorer setting
|
||||
- To kill the Process of an Explorer window, each window has to run in a separate process. Otherwise the process is the same one as the shell process and killing the shell process will crash the shell (Windows ui).
|
||||
- To enable this behavior the setting `Launch folder windows in a separate process` under `Folder Options > View` has to be enabled.
|
||||
- From PowerToys Run you can open the `Folder options` dialog by clicking the information message in the search results. The information message is only shown when searching with action keyword for explorer windows and can be hidden in the plugin settings.
|
||||
- Note: The folder option/process is evaluated in real time. After changing the setting it is enough to search again for the windows.
|
||||
|
||||

|
||||
|
||||
|
||||
### [`SearchController.cs`](src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/SearchController.cs)
|
||||
- The [`SearchController`](src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/SearchController.cs) encapsulates the functions needed to search and find matches.
|
||||
- It is responsible for updating the search text and performing a fuzzy search on all the open windows in an asynchronous manner.
|
||||
## Optional plugin settings
|
||||
- The optional plugin settings are implemented via the [`ISettingProvider`](/src/modules/launcher/Wox.Plugin/ISettingProvider.cs) interface from `Wox.Plugin` project.
|
||||
- All available settings for the plugin are defined in the [`WindowWalkerSettings`](/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/WindowWalkerSettings.cs) class of the plugin. The settings can be accessed everywhere in the plugin code via the static class instance `WindowWalkerSettings.Instance`.
|
||||
- We have the following settings that the user can configure to change the behavior of the plugin:
|
||||
|
||||
### [`Window.cs`](src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/Window.cs)
|
||||
- The [`Window`](src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/Window.cs) class represents a specific window and has functions to get the name of the process, the state of the window (whether it is visible or not), and the `SwitchTowindow` function which switches the desktop focus to the selected window. This action is performed when the user clicks on a window walker plugin result.
|
||||
| Key | Default value | Name/Description |
|
||||
|--------------|-----------|------------|
|
||||
| `ResultsFromVisibleDesktopOnly` | `false` | Show only results from visible desktop |
|
||||
| `SubtitleShowPid` | `false` | Show process id in subtitle |
|
||||
| `SubtitleShowDesktopName` | `true` | Show desktop name in subtitle (If two or more desktops exist) |
|
||||
| `ConfirmKillProcess` | `true` | Request confirmation when killing a process |
|
||||
| `KillProcessTree` | `false` | Kill process and it's child processes |
|
||||
| `OpenAfterKillAndClose` | `false` | Stay open after closing windows and killing processes (Not working with kill process confirmation) |
|
||||
| `HideKillProcessOnElevatedProcesses` | `false` | Hide "kill process" button if additional permissions required |
|
||||
| `HideExplorerSettingInfo` | `false` | Hide Explorer process information |
|
||||
|
||||
|
||||
## Technical details
|
||||
|
||||
### [`OpenWindows.cs`](/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/OpenWindows.cs)
|
||||
- The window walker plugin uses the `EnumWindows` function to enumerate all the open windows in the [`OpenWindows.cs`](/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/OpenWindows.cs) class.
|
||||
|
||||
### [`SearchController.cs`](/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/SearchController.cs)
|
||||
- The [`SearchController`](/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/SearchController.cs) encapsulates the functions needed to search and find matches.
|
||||
- It is responsible for updating the search text and performing a fuzzy search on all the open windows.
|
||||
|
||||
### [`Window.cs`](/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/Window.cs)
|
||||
- The [`Window`](/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/Window.cs) class represents a specific window and has functions to get the name of the window, the state of the window (whether it is visible or not), the `SwitchTowindow` function which switches the desktop focus to the selected window and the `CloseThisWindow` function which closes the window. The `SwitchTowindow` action is performed when the user clicks on a window walker plugin result.
|
||||
- The `Window` class holds a static cache with the process information of all windows we know so far and each window instance has a property which holds its process information (name, file, ...). The process data in the cache and the window property are of the type `WindowProcess`.
|
||||
- To get the desktop information for a window, we use the common [`VirtualDesktopHelper`](/src/modules/launcher/Wox.Plugin/Common/VirtualDesktop/VirtualDesktopHelper.cs) in `Wox.Plugin` project. The instance of `VirtualDesktopHelper` is cached in the [`Main`](/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Main.cs) class of the plugin at runtime. The desktop information is stored in a property of the type [`VDesktop`](/src/modules/launcher/Wox.Plugin/Common/VirtualDesktop/VDesktop.cs).
|
||||
|
||||
### [`WindowProcess.cs`](/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/WindowProcess.cs)
|
||||
- The [`WindowProcess`](/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/WindowProcess.cs) class represents a specific process for a window.
|
||||
- It contains static methods to query process information from the system and instance methods/properties to hold/retrieve the process information we want to know about a window's process.
|
||||
- Additionally, it contains the method `KillThisProcess` to kill the process. (If the user has not enough permissions to kill a process they are requested via UAC.)
|
||||
|
||||
### [`ResultHelper.cs`](/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/ResultHelper.cs)
|
||||
- The [`ResultHelper`](/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/ResultHelper.cs) class contains the code to create the list with all results for PT Run based on the data returned from `SearchController` class.
|
||||
- There is a special result that is added if the folder windows doesn't run in separate processes and the user searches for Explorer windows using the action keyword.
|
||||
- This result informs the user that there is a setting that must be enabled to be able to kill Explorer processes.
|
||||
- The result can be disabled in plugin options. When it is clicked it opens the folder options.
|
||||
|
||||
### [`ContextMenuHelper.cs`](/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/ContextMenuHelper.cs)
|
||||
- The [`ContextMenuHelper`](/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/ContextMenuHelper.cs) class provides the code for the context menu items.
|
||||
|
||||
### [`WindowWalkerSettings.cs`](/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/WindowWalkerSettings.cs)
|
||||
- The [`WindowWalkerSettings`](/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/WindowWalkerSettings.cs) class provides access to all optional plugin settings.
|
||||
- The class has a static property called `Instance` that holds an instance of the class itself. This allows us to access the settings from everywhere in the plugin code without having additional parameters in our methods.
|
||||
|
||||
### Score
|
||||
The window walker plugin uses [`FuzzyMatching`](src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/FuzzyMatching.cs) to get the matching indices and calculates the score by creating a 2 dimensional array of the window and the query text.
|
||||
The window walker plugin uses [`FuzzyMatching`](/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/FuzzyMatching.cs) to get the matching indices and calculates the score by creating a 2 dimensional array of the window and the query text.
|
||||
|
||||
## [Unit Tests](/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker.UnitTests)
|
||||
We have a [Unit Test project](/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker.UnitTests) that executes various test to ensure that the plugin works as expected.
|
||||
|
||||
### [`PluginSettingsTests.cs`](/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker.UnitTests/PluginSettingsTests.cs)
|
||||
- The [`PluginSettingsTests.cs`](/src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker.UnitTests/PluginSettingsTests.cs) class contains tests to validate that all settings exist and that they have the correct default values.
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
- [Program](/doc/devdocs/modules/launcher/plugins/program.md)
|
||||
- [Registry](/doc/devdocs/modules/launcher/plugins/registry.md)
|
||||
- [Shell](/doc/devdocs/modules/launcher/plugins/shell.md)
|
||||
- [Sys](/doc/devdocs/modules/launcher/plugins/sys.md)
|
||||
- [Time and Date](/doc/devdocs/modules/launcher/plugins/timedate.md)
|
||||
- [Windows System Commands](/doc/devdocs/modules/launcher/plugins/system.md)
|
||||
- [Uri](/doc/devdocs/modules/launcher/plugins/uri.md)
|
||||
- [Window Walker](/doc/devdocs/modules/launcher/plugins/windowwalker.md)
|
||||
- [Web Search](/doc/devdocs/modules/launcher/plugins/WebSearch.md)
|
||||
|
||||
22
doc/devdocs/modules/powerpreview/monaco/readme.md
Normal file
22
doc/devdocs/modules/powerpreview/monaco/readme.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Developer Preview (Monaco)
|
||||
|
||||
Developer preview is based on [Microsofts Monaco Editor](https://microsoft.github.io/monaco-editor/) which is maintained by the Visual Studio Code team.
|
||||
|
||||
## Update monaco editor
|
||||
|
||||
1. Download Monaco editor with npm: `npm i monaco-editor`.
|
||||
2. Delete everything except the `min` folder (the minimised code).
|
||||
3. Copy the `min` folder inside the [`monacoSRC`](/src/modules/previewpane/MonacoPreviewHandler/monacoSRC) folder.
|
||||
4. Generate the JSON file (see section below)
|
||||
|
||||
## monaco_languages.json
|
||||
|
||||
[`monaco_languages.json`](/src/modules/previewpane/MonacoPreviewHandler/monaco_languages.json) contains all extensions and Id's for the supported languages of Monaco. The [`FileHandler`](/src/modules/previewpane/MonacoPreviewHandler/FileHandler.cs) class and the installer are using this file.
|
||||
|
||||
### Generate monaco_languages.json file
|
||||
|
||||
After you updated monaco editor or adding a new language you should update the [`monaco_languages.json`](/src/modules/previewpane/MonacoPreviewHandler/monaco_languages.json) file.
|
||||
|
||||
1. Build monaco in debug mode.
|
||||
2. Open [generateLanguagesJson.html](/src/modules/previewpane/MonacoPreviewHandler/generateLanguagesJson.html) in a browser.
|
||||
3. Replace the old JSON file.
|
||||
@@ -38,7 +38,7 @@ Once you've discussed your proposed feature/fix/etc. with a team member, and you
|
||||
### Prerequisites for Compiling PowerToys
|
||||
|
||||
1. Windows 10 April 2018 Update (version 1803) or newer
|
||||
2. Visual Studio Community/Professional/Enterprise 2019
|
||||
2. Visual Studio Community/Professional/Enterprise 2022
|
||||
3. Once you've cloned and started the `PowerToys.sln`, in the solution explorer, if you see a dialog that says `install extra components`, click `install`
|
||||
|
||||
### Get Submodules to compile
|
||||
@@ -69,7 +69,7 @@ The installer can only be compiled in `Release` mode, step 1 and 2 must be done
|
||||
|
||||
### Prerequisites for building the MSI installer
|
||||
|
||||
1. Install the [WiX Toolset Visual Studio 2019 Extension](https://marketplace.visualstudio.com/items?itemName=WixToolset.WixToolsetVisualStudio2019Extension).
|
||||
1. Install the [WiX Toolset Visual Studio 2022 Extension](https://marketplace.visualstudio.com/items?itemName=WixToolset.WixToolsetVisualStudio2022Extension).
|
||||
2. Install the [WiX Toolset build tools](https://wixtoolset.org/releases/).
|
||||
|
||||
### Locally compiling the Bug reporting tool
|
||||
|
||||
BIN
doc/images/icons/Mouse Crosshairs.png
Normal file
BIN
doc/images/icons/Mouse Crosshairs.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
BIN
doc/images/launcher/plugins/timedate.png
Normal file
BIN
doc/images/launcher/plugins/timedate.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 72 KiB |
BIN
doc/images/launcher/plugins/timedate2.png
Normal file
BIN
doc/images/launcher/plugins/timedate2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 93 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 153 KiB |
BIN
doc/images/launcher/plugins/windowwalker_folder_options.png
Normal file
BIN
doc/images/launcher/plugins/windowwalker_folder_options.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
38
doc/planning/awake.md
Normal file
38
doc/planning/awake.md
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
last-update: 3-20-2022
|
||||
---
|
||||
|
||||
# PowerToys Awake Changelog
|
||||
|
||||
## Builds
|
||||
|
||||
The build ID can be found in [`NLog.config`](https://github.com/microsoft/PowerToys/blob/2e3a2b3f96f67c7dfc72963e5135662d3230b5fe/src/modules/awake/Awake/NLog.config#L5) - it is a unique identifier for the current builds that allows better diagnostics (we can look up the build ID from the logs) and offers a way to triage Awake-specific issues faster independent of the PowerToys version. The build ID does not carry any significance beyond that within the PowerToys code base.
|
||||
|
||||
| Build ID | Build Date |
|
||||
|:----------------------------------------------------------|:-----------------|
|
||||
| [`LIBRARIAN_03202022`](#librarian_03202022-march-20-2022) | March 20, 2022 |
|
||||
| `ARBITER_01312022` | January 31, 2022 |
|
||||
|
||||
### `LIBRARIAN_03202022` (March 20, 2022)
|
||||
|
||||
- Changed the tray context menu to be following OS conventions instead of the style offered by Windows Forms. This introduces better support for DPI scaling and theming in the future.
|
||||
- Custom times in the tray can now be configured in the `settings.json` file for awake, through the `tray_times` property. The property values are representative of a `Dictionary<string, int>` and can be in the form of `"YOUR_NAME": LENGTH_IN_SECONDS`:
|
||||
|
||||
```json
|
||||
{
|
||||
"properties": {
|
||||
"awake_keep_display_on": true,
|
||||
"awake_mode": 2,
|
||||
"awake_hours": 0,
|
||||
"awake_minutes": 3,
|
||||
"tray_times": {
|
||||
"Custom length": 1800,
|
||||
"Another custom length": 3600
|
||||
}
|
||||
},
|
||||
"name": "Awake",
|
||||
"version": "1.0"
|
||||
}
|
||||
```
|
||||
|
||||
- Proper Awake background window closure was implemented to ensure that the process collects the correct handle instead of the empty one that was previously done through `System.Diagnostics.Process.GetCurrentProcess().CloseMainWindow()`. This likely can help with the Awake process that is left hanging after PowerToys itself closes.
|
||||
@@ -16,7 +16,6 @@
|
||||
<File DestinationPath="modules\Microsoft.Xaml.Behaviors.dll" SourcePath="..\..\x64\Release\modules\Microsoft.Xaml.Behaviors.dll"/>
|
||||
<File DestinationPath="modules\PowerToys.PowerRenameExt.dll" SourcePath="..\..\x64\Release\modules\PowerToys.PowerRenameExt.dll"/>
|
||||
<File DestinationPath="modules\shortcut_guide.dll" SourcePath="..\..\x64\Release\modules\shortcut_guide.dll"/>
|
||||
<File DestinationPath="modules\PowerRenameUWPUI.exe" SourcePath="..\..\x64\Release\modules\PowerRenameUWPUI.exe"/>
|
||||
<File DestinationPath="modules\PowerToys.ImageResizer.exe" SourcePath="..\..\x64\Release\modules\PowerToys.ImageResizer.exe"/>
|
||||
<File DestinationPath="modules\PowerToys.ImageResizerExt.dll" SourcePath="..\..\x64\Release\modules\PowerToys.ImageResizerExt.dll"/>
|
||||
<File DestinationPath="modules\GalaSoft.MvvmLight.dll" SourcePath="..\..\x64\Release\modules\GalaSoft.MvvmLight.dll"/>
|
||||
|
||||
@@ -42,9 +42,6 @@
|
||||
</uap5:Extension>
|
||||
<com:Extension Category="windows.comServer">
|
||||
<com:ComServer>
|
||||
<com:ExeServer Executable="modules\PowerRenameUWPUI.exe" DisplayName="PowerRenameUWPUI">
|
||||
<com:Class Id="0440049F-D1DC-4E46-B27B-98393D79486B"/>
|
||||
</com:ExeServer>
|
||||
<com:SurrogateServer DisplayName="ImageResizerExt">
|
||||
<com:Class Id="51B4D7E5-7568-4234-B4BB-47FB3C016A69" Path="modules\PowerToys.ImageResizerExt.dll" ThreadingModel="STA"/>
|
||||
</com:SurrogateServer>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
cd /D "%~dp0"
|
||||
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 -winsdk=10.0.18362.0
|
||||
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 -winsdk=10.0.18362.0
|
||||
|
||||
powershell -file update_appxmanifest_version.ps1 || exit /b 1
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
taskkill /f /im PowerRenameUWPUI.exe
|
||||
|
||||
.\uninstall_msix.ps1
|
||||
.\build_msix.ps1
|
||||
.\sign_msix.ps1
|
||||
|
||||
@@ -12,9 +12,6 @@ EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "logger", "..\src\common\logger\logger.vcxproj", "{D9B8FC84-322A-4F9F-BBB9-20915C47DDFD}"
|
||||
EndProject
|
||||
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "PowerToysBootstrapper", "PowerToysSetup\PowerToysBootstrapper.wixproj", "{31D72625-43C1-41B1-B784-BCE4A8DC5543}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{022A9D30-7C4F-416D-A9DF-5FF2661CC0AD} = {022A9D30-7C4F-416D-A9DF-5FF2661CC0AD}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
||||
@@ -20,10 +20,15 @@
|
||||
SuppressRepair="yes" />
|
||||
</BootstrapperApplicationRef>
|
||||
|
||||
<util:FileSearch Variable="HasDotnet3122" Path="[ProgramFiles64Folder]dotnet\shared\Microsoft.WindowsDesktop.App\3.1.22\System.Xaml.dll" Result="exists" />
|
||||
<util:FileSearch Variable="HasDotnet3123" Path="[ProgramFiles64Folder]dotnet\shared\Microsoft.WindowsDesktop.App\3.1.23\System.Xaml.dll" Result="exists" />
|
||||
<util:FileSearch Variable="HasDotnet603" Path="[ProgramFiles64Folder]dotnet\shared\Microsoft.WindowsDesktop.App\6.0.3\System.Xaml.dll" Result="exists" />
|
||||
<util:RegistrySearch Variable="HasWebView2PerMachine" Root="HKLM" Key="SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" Result="exists" />
|
||||
<util:RegistrySearch Variable="HasWebView2PerUser" Root="HKCU" Key="Software\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" Result="exists" />
|
||||
|
||||
<Variable Name="InstallFolder" Type="string" Value="[ProgramFiles64Folder]PowerToys" bal:Overridable="yes"/>
|
||||
|
||||
<Variable Name="MsiLogFolder" Type="string" Value="[LocalAppDataFolder]\Microsoft\PowerToys\" />
|
||||
<Log Disable="no" Prefix='powertoys-bootstrapper-msi-$(var.Version)' Extension=".log" />
|
||||
|
||||
<!-- Only install/upgrade if the version is greater or equal than the currently installed version of PowerToys, to handle the case in which PowerToys was installed from old MSI (before WiX bootstrapper was used) -->
|
||||
<!-- If the previous installation is a bundle installation, just let WiX run its logic. -->
|
||||
@@ -38,22 +43,54 @@
|
||||
|
||||
<Chain>
|
||||
<ExePackage
|
||||
Name="windowsdesktop-runtime-3.1.22-win-x64.exe"
|
||||
Name="windowsdesktop-runtime-3.1.23-win-x64.exe"
|
||||
Compressed="no"
|
||||
Id="DotnetRuntime"
|
||||
DetectCondition="HasDotnet3122"
|
||||
DownloadUrl="https://download.visualstudio.microsoft.com/download/pr/1c14e24b-7f31-42dc-ba3c-83295a2d6f7e/41b93591162dfe556cc160ae44fbe75e/windowsdesktop-runtime-3.1.22-win-x64.exe"
|
||||
InstallCommand="/install /quiet"
|
||||
DetectCondition="HasDotnet3123"
|
||||
DownloadUrl="https://download.visualstudio.microsoft.com/download/pr/0bc6a80a-3f07-411d-8ce3-17aaeb7388ac/ed1000a04fc9c8dca5af35b53263d9ae/windowsdesktop-runtime-3.1.23-win-x64.exe"
|
||||
InstallCommand="/install /quiet /norestart"
|
||||
RepairCommand="/repair /passive /norestart"
|
||||
Permanent="yes"
|
||||
PerMachine="yes"
|
||||
UninstallCommand="/uninstall /quiet /norestart">
|
||||
<ExitCode Value="1638" Behavior="success"/>
|
||||
<RemotePayload
|
||||
Description="Microsoft Windows Desktop Runtime - 3.1.23 (x64)"
|
||||
ProductName="Microsoft Windows Desktop Runtime - 3.1.23 (x64)"
|
||||
Size="54413248"
|
||||
Version="3.1.23.31022"
|
||||
Hash="460D8CD07672A7B686867B0E6CF85A745005AA43" />
|
||||
</ExePackage>
|
||||
<ExePackage
|
||||
Name="windowsdesktop-runtime-6.0.3-win-x64.exe"
|
||||
Compressed="no"
|
||||
Id="DotnetRuntime6"
|
||||
DetectCondition="HasDotnet603"
|
||||
DownloadUrl="https://download.visualstudio.microsoft.com/download/pr/7f3a766e-9516-4579-aaf2-2b150caa465c/d57665f880cdcce816b278a944092965/windowsdesktop-runtime-6.0.3-win-x64.exe"
|
||||
InstallCommand="/install /quiet /norestart"
|
||||
RepairCommand="/repair /passive /norestart"
|
||||
Permanent="yes"
|
||||
PerMachine="yes"
|
||||
UninstallCommand="/uninstall /quiet /norestart">
|
||||
<ExitCode Value="1638" Behavior="success"/>
|
||||
<RemotePayload
|
||||
Description="Microsoft Windows Desktop Runtime - 6.0.3 (x64)"
|
||||
ProductName="Microsoft Windows Desktop Runtime - 6.0.3 (x64)"
|
||||
Size="57153808"
|
||||
Version="6.0.3.31024"
|
||||
Hash="85EB71B760EBA108348824A4928ED2BA9775BE76" />
|
||||
</ExePackage>
|
||||
<ExePackage
|
||||
Name="MicrosoftEdgeWebview2Setup.exe"
|
||||
Compressed="yes"
|
||||
Id="WebView2"
|
||||
DetectCondition="HasWebView2PerMachine OR HasWebView2PerUser"
|
||||
SourceFile="WebView2\MicrosoftEdgeWebview2Setup.exe"
|
||||
InstallCommand="/silent /install"
|
||||
RepairCommand="/repair /passive"
|
||||
Permanent="yes"
|
||||
PerMachine="yes"
|
||||
UninstallCommand="/uninstall /quiet">
|
||||
<RemotePayload
|
||||
Description="Microsoft Windows Desktop Runtime - 3.1.22 (x64)"
|
||||
ProductName="Microsoft Windows Desktop Runtime - 3.1.22 (x64)"
|
||||
Size="54342024"
|
||||
Version="3.1.22.30721"
|
||||
Hash="08EF2F6CFDB33946061884B1CE13FA867EFBD576" />
|
||||
UninstallCommand="/silent /uninstall">
|
||||
</ExePackage>
|
||||
<MsiPackage
|
||||
SourceFile="x64\Release\PowerToysSetup-$(var.Version)-x64.msi"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<Import Project="..\packages\WiX.3.11.2\build\wix.props" Condition="Exists('..\packages\WiX.3.11.2\build\wix.props')" />
|
||||
<Import Project="..\..\src\Version.props" />
|
||||
<PropertyGroup>
|
||||
<DefineConstants>Version=$(Version)</DefineConstants>
|
||||
<DefineConstants>Version=$(Version);MonacoSRCHarvestPath=$(ProjectDir)..\..\x64\$(Configuration)\modules\FileExplorerPreview\monacoSRC</DefineConstants>
|
||||
<Name>PowerToysInstaller</Name>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
@@ -35,6 +35,7 @@
|
||||
<Compile Include="CustomDialogs\PTLicenseDlg.wxs" />
|
||||
<Compile Include="CustomDialogs\WixUI_PTInstallDir.wxs" />
|
||||
<Compile Include="Product.wxs" />
|
||||
<Compile Include="MonacoSRC.wxs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WixExtension Include="WixUtilExtension">
|
||||
@@ -96,4 +97,17 @@ call "..\..\publish.cmd"
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<Target Name="BeforeBuild">
|
||||
<HeatDirectory Directory="..\..\src\modules\previewpane\MonacoPreviewHandler\monacoSRC"
|
||||
PreprocessorVariable="var.MonacoSRCHarvestPath"
|
||||
OutputFile="MonacoSRC.wxs"
|
||||
ComponentGroupName="MonacoSRCHeatGenerated"
|
||||
DirectoryRefId="MonacoPreviewHandlerMonacoSRCFolder"
|
||||
AutogenerateGuids="true"
|
||||
ToolPath="$(WixToolPath)"
|
||||
RunAsSeparateProcess="true"
|
||||
SuppressFragments="true"
|
||||
SuppressRegistry="true"
|
||||
SuppressRootDirectory="true" />
|
||||
</Target>
|
||||
</Project>
|
||||
File diff suppressed because it is too large
Load Diff
BIN
installer/PowerToysSetup/WebView2/MicrosoftEdgeWebview2Setup.exe
Normal file
BIN
installer/PowerToysSetup/WebView2/MicrosoftEdgeWebview2Setup.exe
Normal file
Binary file not shown.
@@ -75,7 +75,7 @@ UINT __stdcall ApplyModulesRegistryChangeSetsCA(MSIHANDLE hInstall)
|
||||
hr = getInstallFolder(hInstall, installationFolder);
|
||||
ExitOnFailure(hr, "Failed to get installFolder.");
|
||||
|
||||
for (const auto& changeSet : getAllModulesChangeSets(installationFolder))
|
||||
for (const auto& changeSet : getAllOnByDefaultModulesChangeSets(installationFolder))
|
||||
{
|
||||
if (!changeSet.apply())
|
||||
{
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<Import Project="..\..\deps\spdlog.props" />
|
||||
|
||||
@@ -5,3 +5,6 @@ dotnet_diagnostic.SA1201.severity = none
|
||||
|
||||
# CA1303: Do not pass literals as localized parameters
|
||||
dotnet_diagnostic.CA1303.severity = suggestion
|
||||
|
||||
# CA1051: Do not declare visible instance fields
|
||||
dotnet_code_quality.ca1051.exclude_structs = true
|
||||
|
||||
@@ -11,6 +11,12 @@
|
||||
<ProjectName>PowerToys.ActionRunner</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\..\deps\expected.props" />
|
||||
<PropertyGroup>
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
## Code organization
|
||||
The PowerToys are split into DLLs for each PowerToy module ([`modules`](/src/modules) folder), and an executable ([`runner`](/src/runner) folder) that loads and manages those DLLs.
|
||||
|
||||
The settings window is a separate executable, contained in [`settings`](/src/settings) folder. It utilizes a WebView to display an HTML-based settings window (contained in [`settings-web`](/src/settings-web) folder).
|
||||
The settings window is a separate executable, contained in [`settings-ui`](/src/settings-ui) folder. It utilizes a WebView to display an HTML-based settings window.
|
||||
|
||||
The [`common`](/src/common) contains code for a static library with helper functions, used by both the runner and the PowerToys modules.
|
||||
|
||||
@@ -153,7 +153,7 @@ bool InstallNewVersionStage2(std::wstring installer_path, std::wstring_view inst
|
||||
sei.fMask = { SEE_MASK_FLAG_NO_UI | SEE_MASK_NOASYNC | SEE_MASK_NOCLOSEPROCESS | SEE_MASK_NO_CONSOLE };
|
||||
sei.lpFile = installer_path.c_str();
|
||||
sei.nShow = SW_SHOWNORMAL;
|
||||
std::wstring parameters = L"/passive";
|
||||
std::wstring parameters = L"/passive /norestart";
|
||||
sei.lpParameters = parameters.c_str();
|
||||
|
||||
success = ShellExecuteExW(&sei) == TRUE;
|
||||
|
||||
@@ -11,6 +11,12 @@
|
||||
<ProjectName>PowerToys.Update</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\..\deps\expected.props" />
|
||||
<PropertyGroup>
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
|
||||
@@ -31,6 +31,10 @@ using System.Diagnostics.CodeAnalysis;
|
||||
[assembly: SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "We need to have the names of these keys in lowercase to be able to compare with the keys becoming form the template json. ContainsKey does not allow StringComparer specification to IgnoreCase", Scope = "member", Target = "Microsoft.Templates.Core.ITemplateInfoExtensions.#GetQueryableProperties(Microsoft.TemplateEngine.Abstractions.ITemplateInfo)")]
|
||||
[assembly: SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "We need to have the names of these keys in lowercase to be able to compare with the keys becoming form the template json. ContainsKey does not allow StringComparer specification to IgnoreCase", Scope = "member", Target = "Microsoft.Templates.Core.Composition.CompositionQuery.#Match(System.Collections.Generic.IEnumerable`1<Microsoft.Templates.Core.Composition.QueryNode>,Microsoft.Templates.Core.Composition.QueryablePropertyDictionary)")]
|
||||
[assembly: SuppressMessage("Usage", "VSTHRD103:Call async methods when in an async method", Justification = "Resource DictionaryWriter does not implement flush async", Scope = "member", Target = "~M:Microsoft.Templates.Core.PostActions.Catalog.Merge.MergeResourceDictionaryPostAction.ExecuteInternalAsync~System.Threading.Tasks.Task")]
|
||||
[assembly: SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "Used in a lot of places for meaningful method names")]
|
||||
[assembly: SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Static methods may improve performance but decrease maintainability")]
|
||||
[assembly: SuppressMessage("Naming", "CA1711:Identifiers should not have incorrect suffix", Justification = "Renaming everything would be a lot of work. It does not do any harm if an EventHandler delegate ends with the suffix EventHandler. Besides this, the Rule causes some false positives.")]
|
||||
[assembly: SuppressMessage("Performance", "CA1838:Avoid 'StringBuilder' parameters for P/Invokes", Justification = "We are not concerned about the performance impact of marshaling a StringBuilder")]
|
||||
|
||||
// Threading suppressions
|
||||
[assembly: SuppressMessage("Microsoft.VisualStudio.Threading.Analyzers", "VSTHRD100:Avoid async void methods", Justification = "Event handlers needs async void", Scope = "member", Target = "~M:Microsoft.Templates.UI.Controls.Notification.OnClose")]
|
||||
@@ -45,6 +49,10 @@ using System.Diagnostics.CodeAnalysis;
|
||||
[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "Microsoft.Templates.Core.Locations.JunctionNativeMethods.ThrowLastWin32Error(System.String)", Scope = "member", Target = "Microsoft.Templates.Core.Locations.JunctionNativeMethods.#InternalGetTarget(Microsoft.Win32.SafeHandles.SafeFileHandle)", Justification = "Only used for local generation")]
|
||||
[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "Microsoft.Templates.Core.Locations.JunctionNativeMethods.ThrowLastWin32Error(System.String)", Scope = "member", Target = "Microsoft.Templates.Core.Locations.JunctionNativeMethods.#OpenReparsePoint(System.String,Microsoft.Templates.Core.Locations.JunctionNativeMethods+EFileAccess)", Justification = "Only used for local generation")]
|
||||
[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Documents.InlineCollection.Add(System.String)", Scope = "member", Target = "Microsoft.Templates.UI.Extensions.TextBlockExtensions.#OnSequentialFlowStepChanged(System.Windows.DependencyObject,System.Windows.DependencyPropertyChangedEventArgs)", Justification = "No text here")]
|
||||
[assembly: SuppressMessage("Globalization", "CA1309:Use ordinal string comparison", Justification = "The user's search term should be compared with culture based rules.", Scope = "type", Target = "~T:Microsoft.PowerToys.Run.Plugin.TimeDate.Components.SearchController")]
|
||||
|
||||
// FxCop warning suppression for uninstantiated TestFixture classes
|
||||
[assembly: SuppressMessage("Microsoft.Performance", "CA1812: Avoid uninstantiated internal classes", Scope = "module", Justification = "CA1812 will be thrown for every file in the test project. This is mentioned here: dotnet/roslyn-analyzers#1830")]
|
||||
|
||||
// Code quality
|
||||
[assembly: SuppressMessage("CodeQuality", "IDE0076:Invalid global 'SuppressMessageAttribute'", Justification = "Affect predefined supressions.")]
|
||||
|
||||
@@ -11,6 +11,12 @@
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\Version.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<UseWPF>true</UseWPF>
|
||||
<Platforms>x64</Platforms>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
@@ -10,11 +10,11 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ControlzEx" Version="4.4.0" />
|
||||
<PackageReference Include="ControlzEx" Version="5.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0">
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
||||
@@ -107,6 +107,11 @@ namespace Common.UI
|
||||
ChangeTheme(_settingsTheme == Theme.System ? Theme.System : _currentTheme);
|
||||
}
|
||||
|
||||
public static string GetWindowsBaseColor()
|
||||
{
|
||||
return ControlzEx.Theming.WindowsThemeHelper.GetWindowsBaseColor();
|
||||
}
|
||||
|
||||
public void ChangeTheme(Theme theme, bool fromSettings = false)
|
||||
{
|
||||
if (fromSettings)
|
||||
|
||||
@@ -11,6 +11,12 @@
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
@@ -25,7 +31,7 @@
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<AdditionalIncludeDirectories>..\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace DPIAware
|
||||
return GetScreenDPIForMonitor(targetMonitor, dpi);
|
||||
}
|
||||
|
||||
void Convert(HMONITOR monitor_handle, int& width, int& height)
|
||||
void Convert(HMONITOR monitor_handle, float& width, float& height)
|
||||
{
|
||||
if (monitor_handle == NULL)
|
||||
{
|
||||
@@ -55,12 +55,12 @@ namespace DPIAware
|
||||
UINT dpi_x, dpi_y;
|
||||
if (GetDpiForMonitor(monitor_handle, MDT_EFFECTIVE_DPI, &dpi_x, &dpi_y) == S_OK)
|
||||
{
|
||||
width = width * static_cast<int>(dpi_x) / DEFAULT_DPI;
|
||||
height = height * static_cast<int>(dpi_y) / DEFAULT_DPI;
|
||||
width = width * dpi_x / DEFAULT_DPI;
|
||||
height = height * dpi_y / DEFAULT_DPI;
|
||||
}
|
||||
}
|
||||
|
||||
void ConvertByCursorPosition(int& width, int& height)
|
||||
void ConvertByCursorPosition(float& width, float& height)
|
||||
{
|
||||
HMONITOR targetMonitor = nullptr;
|
||||
POINT currentCursorPos{ 0 };
|
||||
@@ -73,7 +73,7 @@ namespace DPIAware
|
||||
Convert(targetMonitor, width, height);
|
||||
}
|
||||
|
||||
void InverseConvert(HMONITOR monitor_handle, int& width, int& height)
|
||||
void InverseConvert(HMONITOR monitor_handle, float& width, float& height)
|
||||
{
|
||||
if (monitor_handle == NULL)
|
||||
{
|
||||
@@ -84,8 +84,8 @@ namespace DPIAware
|
||||
UINT dpi_x, dpi_y;
|
||||
if (GetDpiForMonitor(monitor_handle, MDT_EFFECTIVE_DPI, &dpi_x, &dpi_y) == S_OK)
|
||||
{
|
||||
width = width * DEFAULT_DPI / static_cast<int>(dpi_x);
|
||||
height = height * DEFAULT_DPI / static_cast<int>(dpi_y);
|
||||
width = width * DEFAULT_DPI / dpi_x;
|
||||
height = height * DEFAULT_DPI / dpi_y;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,9 +11,9 @@ namespace DPIAware
|
||||
HRESULT GetScreenDPIForWindow(HWND hwnd, UINT& dpi);
|
||||
HRESULT GetScreenDPIForPoint(POINT p, UINT& dpi);
|
||||
HRESULT GetScreenDPIForCursor(UINT& dpi);
|
||||
void Convert(HMONITOR monitor_handle, int& width, int& height);
|
||||
void ConvertByCursorPosition(int& width, int& height);
|
||||
void InverseConvert(HMONITOR monitor_handle, int& width, int& height);
|
||||
void Convert(HMONITOR monitor_handle, float& width, float& height);
|
||||
void ConvertByCursorPosition(float& width, float& height);
|
||||
void InverseConvert(HMONITOR monitor_handle, float& width, float& height);
|
||||
void EnableDPIAwarenessForThisProcess();
|
||||
|
||||
enum AwarenessLevel
|
||||
|
||||
@@ -1,33 +1,20 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<Import Project="..\..\Version.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<Platforms>x64</Platforms>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<Version>$(Version).0</Version>
|
||||
<Authors>Microsoft Corporation</Authors>
|
||||
<Product>PowerToys</Product>
|
||||
<Description>PowerToys ManagedCommon</Description>
|
||||
<Copyright>Copyright (C) 2020 Microsoft Corporation</Copyright>
|
||||
<RepositoryUrl>https://github.com/microsoft/PowerToys</RepositoryUrl>
|
||||
<RepositoryType>Github</RepositoryType>
|
||||
<PackageTags>PowerToys</PackageTags>
|
||||
<NeutralLanguage>en-US</NeutralLanguage>
|
||||
<AssemblyName>PowerToys.ManagedCommon</AssemblyName>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0">
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
||||
@@ -2,37 +2,38 @@
|
||||
|
||||
<Import Project="..\..\..\Version.props" />
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<Platforms>x64</Platforms>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<Version>$(Version).0</Version>
|
||||
<Authors>Microsoft Corporation</Authors>
|
||||
<Product>PowerToys</Product>
|
||||
<Description>PowerToys Telemetry</Description>
|
||||
<Copyright>Copyright (C) 2020 Microsoft Corporation</Copyright>
|
||||
<RepositoryUrl>https://github.com/microsoft/PowerToys</RepositoryUrl>
|
||||
<RepositoryType>Github</RepositoryType>
|
||||
<PackageTags>PowerToys</PackageTags>
|
||||
<NeutralLanguage>en-US</NeutralLanguage>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<AssemblyName>PowerToys.ManagedTelemetry</AssemblyName>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\Telemetry\TelemetryBase.cs" Link="TelemetryBase.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<AdditionalFiles Include="..\..\..\codeAnalysis\StyleCop.json">
|
||||
<Link>StyleCop.json</Link>
|
||||
</AdditionalFiles>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="StyleCop.Analyzers">
|
||||
<Version>1.1.118</Version>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\..\codeAnalysis\GlobalSuppressions.cs">
|
||||
<Link>GlobalSuppressions.cs</Link>
|
||||
|
||||
@@ -12,6 +12,12 @@
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
@@ -40,7 +46,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets')" />
|
||||
|
||||
@@ -5,6 +5,9 @@ namespace PTSettingsHelper
|
||||
{
|
||||
constexpr inline const wchar_t* settings_filename = L"\\settings.json";
|
||||
constexpr inline const wchar_t* oobe_filename = L"oobe_settings.json";
|
||||
constexpr inline const wchar_t* last_version_run_filename = L"last_version_run.json";
|
||||
constexpr inline const wchar_t* opened_at_first_launch_json_field_name = L"openedAtFirstLaunch";
|
||||
constexpr inline const wchar_t* last_version_json_field_name = L"last_version";
|
||||
|
||||
std::wstring get_root_save_folder_location()
|
||||
{
|
||||
@@ -90,7 +93,7 @@ namespace PTSettingsHelper
|
||||
return false;
|
||||
}
|
||||
|
||||
bool opened = saved_settings->GetNamedBoolean(L"openedAtFirstLaunch", false);
|
||||
bool opened = saved_settings->GetNamedBoolean(opened_at_first_launch_json_field_name, false);
|
||||
return opened;
|
||||
}
|
||||
|
||||
@@ -103,8 +106,39 @@ namespace PTSettingsHelper
|
||||
oobePath = oobePath.append(oobe_filename);
|
||||
|
||||
json::JsonObject obj;
|
||||
obj.SetNamedValue(L"openedAtFirstLaunch", json::value(true));
|
||||
obj.SetNamedValue(opened_at_first_launch_json_field_name, json::value(true));
|
||||
|
||||
json::to_file(oobePath.c_str(), obj);
|
||||
}
|
||||
|
||||
std::wstring get_last_version_run()
|
||||
{
|
||||
|
||||
std::filesystem::path lastVersionRunPath(PTSettingsHelper::get_root_save_folder_location());
|
||||
lastVersionRunPath = lastVersionRunPath.append(last_version_run_filename);
|
||||
if (std::filesystem::exists(lastVersionRunPath))
|
||||
{
|
||||
auto saved_settings = json::from_file(lastVersionRunPath.c_str());
|
||||
if (!saved_settings.has_value())
|
||||
{
|
||||
return L"";
|
||||
}
|
||||
|
||||
std::wstring last_version = saved_settings->GetNamedString(last_version_json_field_name, L"").c_str();
|
||||
return last_version;
|
||||
}
|
||||
return L"";
|
||||
}
|
||||
|
||||
void save_last_version_run(const std::wstring& version)
|
||||
{
|
||||
std::filesystem::path lastVersionRunPath(PTSettingsHelper::get_root_save_folder_location());
|
||||
lastVersionRunPath = lastVersionRunPath.append(last_version_run_filename);
|
||||
|
||||
json::JsonObject obj;
|
||||
obj.SetNamedValue(last_version_json_field_name, json::value(version));
|
||||
|
||||
json::to_file(lastVersionRunPath.c_str(), obj);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,4 +21,6 @@ namespace PTSettingsHelper
|
||||
|
||||
bool get_oobe_opened_state();
|
||||
void save_oobe_opened_state();
|
||||
std::wstring get_last_version_run();
|
||||
void save_last_version_run(const std::wstring& version);
|
||||
}
|
||||
|
||||
@@ -17,10 +17,10 @@ namespace Microsoft.PowerToys.Telemetry
|
||||
None = 0,
|
||||
|
||||
/// <nodoc/>
|
||||
ProductAndServicePerformance = 0x0u,
|
||||
ProductAndServicePerformance = 1,
|
||||
|
||||
/// <nodoc/>
|
||||
ProductAndServiceUsage = 0x0u,
|
||||
ProductAndServiceUsage = 2,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -12,6 +12,12 @@
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
|
||||
@@ -13,6 +13,12 @@
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<PropertyGroup>
|
||||
<AssemblyTitle>PowerToys.Interop</AssemblyTitle>
|
||||
<AssemblyCompany>Microsoft Corp.</AssemblyCompany>
|
||||
<AssemblyCopyright>Copyright (C) 2019 Microsoft Corp.</AssemblyCopyright>
|
||||
<AssemblyCopyright>Copyright (C) 2022 Microsoft Corp.</AssemblyCopyright>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
@@ -19,6 +19,12 @@
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CLRSupport>true</CLRSupport>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
|
||||
@@ -2,87 +2,67 @@
|
||||
<Import Project="..\..\..\Version.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
|
||||
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
|
||||
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
|
||||
<Platforms>x64</Platforms>
|
||||
<AssemblyTitle>interop-tests</AssemblyTitle>
|
||||
<Company>Microsoft Corp.</Company>
|
||||
<Copyright>Copyright (C) 2020 Microsoft Corp.</Copyright>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<EnableNETAnalyzers>true</EnableNETAnalyzers>
|
||||
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Microsoft.Interop.Tests</RootNamespace>
|
||||
<AssemblyName>Microsoft.Interop.Tests</AssemblyName>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
|
||||
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
|
||||
<Platforms>x64</Platforms>
|
||||
<AssemblyTitle>interop-tests</AssemblyTitle>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Microsoft.Interop.Tests</RootNamespace>
|
||||
<AssemblyName>Microsoft.Interop.Tests</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.5" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.5" />
|
||||
<PackageReference Include="coverlet.collector" Version="3.0.3">
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.3" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.3" />
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers">
|
||||
<Version>3.3.0</Version>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="StyleCop.Analyzers">
|
||||
<Version>1.1.118</Version>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="StyleCop.Analyzers">
|
||||
<Version>1.1.118</Version>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\..\codeAnalysis\GlobalSuppressions.cs">
|
||||
<Link>GlobalSuppressions.cs</Link>
|
||||
</Compile>
|
||||
</Compile>
|
||||
<AdditionalFiles Include="..\..\..\codeAnalysis\StyleCop.json">
|
||||
<Link>StyleCop.json</Link>
|
||||
</AdditionalFiles>
|
||||
<Link>StyleCop.json</Link>
|
||||
</AdditionalFiles>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PowerToys.Interop.vcxproj" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -132,7 +132,7 @@ public
|
||||
auto names = gcnew List<String ^>();
|
||||
for (const auto& device : MicrophoneDevice::getAllActive())
|
||||
{
|
||||
names->Add(gcnew String(device.name().data()));
|
||||
names->Add(gcnew String(device->name().data()));
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,12 @@
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<Import Project="..\..\..\deps\spdlog.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
|
||||
@@ -27,6 +27,7 @@ struct LogSettings
|
||||
inline const static std::wstring keyboardManagerLogPath = L"Logs\\keyboard-manager-log.txt";
|
||||
inline const static std::string findMyMouseLoggerName = "find-my-mouse";
|
||||
inline const static std::string mouseHighlighterLoggerName = "mouse-highlighter";
|
||||
inline const static std::string mousePointerCrosshairsLoggerName = "mouse-pointer-crosshairs";
|
||||
inline const static std::string powerRenameLoggerName = "powerrename";
|
||||
inline const static std::string alwaysOnTopLoggerName = "always-on-top";
|
||||
inline const static std::wstring alwaysOnTopLogPath = L"always-on-top-log.txt";
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -11,6 +11,12 @@
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
|
||||
@@ -12,6 +12,12 @@
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
|
||||
@@ -13,6 +13,12 @@
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
|
||||
@@ -189,6 +189,7 @@ inline bool drop_elevated_privileges()
|
||||
// Run command as elevated user, returns true if succeeded
|
||||
inline HANDLE run_elevated(const std::wstring& file, const std::wstring& params)
|
||||
{
|
||||
Logger::info(L"run_elevated with params={}", params);
|
||||
SHELLEXECUTEINFOW exec_info = { 0 };
|
||||
exec_info.cbSize = sizeof(SHELLEXECUTEINFOW);
|
||||
exec_info.lpVerb = L"runas";
|
||||
@@ -206,6 +207,7 @@ inline HANDLE run_elevated(const std::wstring& file, const std::wstring& params)
|
||||
// Run command as non-elevated user, returns true if succeeded, puts the process id into returnPid if returnPid != NULL
|
||||
inline bool run_non_elevated(const std::wstring& file, const std::wstring& params, DWORD* returnPid)
|
||||
{
|
||||
Logger::info(L"run_non_elevated with params={}", params);
|
||||
auto executable_args = L"\"" + file + L"\"";
|
||||
if (!params.empty())
|
||||
{
|
||||
|
||||
32
src/common/utils/excluded_apps.h
Normal file
32
src/common/utils/excluded_apps.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
// Checks if a process path is included in a list of strings.
|
||||
inline bool find_app_name_in_path(const std::wstring& where, const std::vector<std::wstring>& what)
|
||||
{
|
||||
for (const auto& row : what)
|
||||
{
|
||||
const auto pos = where.rfind(row);
|
||||
const auto last_slash = where.rfind('\\');
|
||||
//Check that row occurs in where, and its last occurrence contains in itself the first character after the last backslash.
|
||||
if (pos != std::wstring::npos && pos <= last_slash + 1 && pos + row.length() > last_slash)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool find_folder_in_path(const std::wstring& where, const std::vector<std::wstring>& what)
|
||||
{
|
||||
for (const auto& row : what)
|
||||
{
|
||||
const auto pos = where.rfind(row);
|
||||
if (pos != std::wstring::npos)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -2,10 +2,27 @@
|
||||
|
||||
#include "registry.h"
|
||||
|
||||
#include <common/utils/json.h>
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
namespace NonLocalizable
|
||||
{
|
||||
const static wchar_t* MONACO_LANGUAGES_FILE_NAME = L"modules\\FileExplorerPreview\\monaco_languages.json";
|
||||
const static wchar_t* ListID = L"list";
|
||||
const static wchar_t* ExtensionsID = L"extensions";
|
||||
const static std::vector<std::wstring> ExtSVG = { L".svg" };
|
||||
const static std::vector<std::wstring> ExtMarkdown = { L".md", L".markdown", L".mdown", L".mkdn", L".mkd", L".mdwn", L".mdtxt", L".mdtext" };
|
||||
const static std::vector<std::wstring> ExtPDF = { L".pdf" };
|
||||
const static std::vector<std::wstring> ExtGCode = { L".gcode" };
|
||||
const static std::vector<std::wstring> ExtSTL = { L".stl" };
|
||||
const static std::vector<std::wstring> ExtNoNoNo = {
|
||||
L".svgz" //Monaco cannot handle this file type at all; it's a binary file.
|
||||
};
|
||||
}
|
||||
|
||||
inline registry::ChangeSet getSvgPreviewHandlerChangeSet(const std::wstring installationDir, const bool perUser)
|
||||
{
|
||||
using namespace registry::shellex;
|
||||
@@ -19,7 +36,7 @@ inline registry::ChangeSet getSvgPreviewHandlerChangeSet(const std::wstring inst
|
||||
registry::DOTNET_COMPONENT_CATEGORY_CLSID,
|
||||
L"Microsoft.PowerToys.PreviewHandler.Svg.SvgPreviewHandler",
|
||||
L"Svg Preview Handler",
|
||||
L".svg");
|
||||
NonLocalizable::ExtSVG);
|
||||
}
|
||||
|
||||
inline registry::ChangeSet getMdPreviewHandlerChangeSet(const std::wstring installationDir, const bool perUser)
|
||||
@@ -33,7 +50,70 @@ inline registry::ChangeSet getMdPreviewHandlerChangeSet(const std::wstring insta
|
||||
registry::DOTNET_COMPONENT_CATEGORY_CLSID,
|
||||
L"Microsoft.PowerToys.PreviewHandler.Markdown.MarkdownPreviewHandler",
|
||||
L"Markdown Preview Handler",
|
||||
L".md");
|
||||
NonLocalizable::ExtMarkdown);
|
||||
}
|
||||
|
||||
inline registry::ChangeSet getMonacoPreviewHandlerChangeSet(const std::wstring installationDir, const bool perUser)
|
||||
{
|
||||
using namespace registry::shellex;
|
||||
|
||||
// Set up a list of extensions for the preview handler to take over
|
||||
std::vector<std::wstring> extensions;
|
||||
|
||||
// Set up a list of extensions that Monaco support but the preview handler shouldn't take over
|
||||
std::vector<std::wstring> ExtExclusions;
|
||||
ExtExclusions.insert(ExtExclusions.end(), NonLocalizable::ExtMarkdown.begin(), NonLocalizable::ExtMarkdown.end());
|
||||
ExtExclusions.insert(ExtExclusions.end(), NonLocalizable::ExtSVG.begin(), NonLocalizable::ExtSVG.end());
|
||||
ExtExclusions.insert(ExtExclusions.end(), NonLocalizable::ExtNoNoNo.begin(), NonLocalizable::ExtNoNoNo.end());
|
||||
bool IsExcluded = false;
|
||||
|
||||
std::wstring languagesFilePath = fs::path{ installationDir } / NonLocalizable::MONACO_LANGUAGES_FILE_NAME;
|
||||
auto json = json::from_file(languagesFilePath);
|
||||
|
||||
if (json)
|
||||
{
|
||||
try
|
||||
{
|
||||
auto list = json->GetNamedArray(NonLocalizable::ListID);
|
||||
for (uint32_t i = 0; i < list.Size(); ++i)
|
||||
{
|
||||
auto entry = list.GetObjectAt(i);
|
||||
auto extensionsList = entry.GetNamedArray(NonLocalizable::ExtensionsID);
|
||||
|
||||
for (uint32_t j = 0; j < extensionsList.Size(); ++j)
|
||||
{
|
||||
auto extension = extensionsList.GetStringAt(j);
|
||||
|
||||
// Ignore extensions in the exclusion list
|
||||
IsExcluded = false;
|
||||
|
||||
for (std::wstring k : ExtExclusions)
|
||||
{
|
||||
if (std::wstring{ extension } == k)
|
||||
{
|
||||
IsExcluded = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (IsExcluded) { continue; }
|
||||
extensions.push_back(std::wstring{ extension });
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
return generatePreviewHandler(PreviewHandlerType::preview,
|
||||
perUser,
|
||||
L"{afbd5a44-2520-4ae0-9224-6cfce8fe4400}",
|
||||
get_std_product_version(),
|
||||
(fs::path{ installationDir } / LR"d(modules\FileExplorerPreview\PowerToys.MonacoPreviewHandler.comhost.dll)d").wstring(),
|
||||
registry::DOTNET_COMPONENT_CATEGORY_CLSID,
|
||||
L"Microsoft.PowerToys.PreviewHandler.Monaco.MonacoPreviewHandler",
|
||||
L"Monaco Preview Handler",
|
||||
extensions);
|
||||
}
|
||||
|
||||
inline registry::ChangeSet getPdfPreviewHandlerChangeSet(const std::wstring installationDir, const bool perUser)
|
||||
@@ -47,7 +127,7 @@ inline registry::ChangeSet getPdfPreviewHandlerChangeSet(const std::wstring inst
|
||||
registry::DOTNET_COMPONENT_CATEGORY_CLSID,
|
||||
L"Microsoft.PowerToys.PreviewHandler.Pdf.PdfPreviewHandler",
|
||||
L"Pdf Preview Handler",
|
||||
L".pdf");
|
||||
NonLocalizable::ExtPDF);
|
||||
}
|
||||
|
||||
inline registry::ChangeSet getGcodePreviewHandlerChangeSet(const std::wstring installationDir, const bool perUser)
|
||||
@@ -61,7 +141,7 @@ inline registry::ChangeSet getGcodePreviewHandlerChangeSet(const std::wstring in
|
||||
registry::DOTNET_COMPONENT_CATEGORY_CLSID,
|
||||
L"Microsoft.PowerToys.PreviewHandler.Gcode.GcodePreviewHandler",
|
||||
L"G-code Preview Handler",
|
||||
L".gcode");
|
||||
NonLocalizable::ExtGCode);
|
||||
}
|
||||
|
||||
inline registry::ChangeSet getSvgThumbnailHandlerChangeSet(const std::wstring installationDir, const bool perUser)
|
||||
@@ -75,7 +155,8 @@ inline registry::ChangeSet getSvgThumbnailHandlerChangeSet(const std::wstring in
|
||||
registry::DOTNET_COMPONENT_CATEGORY_CLSID,
|
||||
L"Microsoft.PowerToys.ThumbnailHandler.Svg.SvgThumbnailProvider",
|
||||
L"Svg Thumbnail Provider",
|
||||
L".svg");
|
||||
NonLocalizable::ExtSVG,
|
||||
L"Picture");
|
||||
}
|
||||
|
||||
inline registry::ChangeSet getPdfThumbnailHandlerChangeSet(const std::wstring installationDir, const bool perUser)
|
||||
@@ -89,7 +170,7 @@ inline registry::ChangeSet getPdfThumbnailHandlerChangeSet(const std::wstring in
|
||||
registry::DOTNET_COMPONENT_CATEGORY_CLSID,
|
||||
L"Microsoft.PowerToys.ThumbnailHandler.Pdf.PdfThumbnailProvider",
|
||||
L"Pdf Thumbnail Provider",
|
||||
L".pdf");
|
||||
NonLocalizable::ExtPDF);
|
||||
}
|
||||
|
||||
inline registry::ChangeSet getGcodeThumbnailHandlerChangeSet(const std::wstring installationDir, const bool perUser)
|
||||
@@ -103,7 +184,33 @@ inline registry::ChangeSet getGcodeThumbnailHandlerChangeSet(const std::wstring
|
||||
registry::DOTNET_COMPONENT_CATEGORY_CLSID,
|
||||
L"Microsoft.PowerToys.ThumbnailHandler.Gcode.GcodeThumbnailProvider",
|
||||
L"G-code Thumbnail Provider",
|
||||
L".gcode");
|
||||
NonLocalizable::ExtGCode);
|
||||
}
|
||||
|
||||
inline registry::ChangeSet getStlThumbnailHandlerChangeSet(const std::wstring installationDir, const bool perUser)
|
||||
{
|
||||
using namespace registry::shellex;
|
||||
return generatePreviewHandler(PreviewHandlerType::thumbnail,
|
||||
perUser,
|
||||
L"{8BC8AFC2-4E7C-4695-818E-8C1FFDCEA2AF}",
|
||||
get_std_product_version(),
|
||||
(fs::path{ installationDir } / LR"d(modules\FileExplorerPreview\PowerToys.StlThumbnailProvider.comhost.dll)d").wstring(),
|
||||
registry::DOTNET_COMPONENT_CATEGORY_CLSID,
|
||||
L"Microsoft.PowerToys.ThumbnailHandler.Stl.StlThumbnailProvider",
|
||||
L"Stl Thumbnail Provider",
|
||||
NonLocalizable::ExtSTL);
|
||||
}
|
||||
|
||||
inline std::vector<registry::ChangeSet> getAllOnByDefaultModulesChangeSets(const std::wstring installationDir)
|
||||
{
|
||||
constexpr bool PER_USER = true;
|
||||
return { getSvgPreviewHandlerChangeSet(installationDir, PER_USER),
|
||||
getMdPreviewHandlerChangeSet(installationDir, PER_USER),
|
||||
getMonacoPreviewHandlerChangeSet(installationDir, PER_USER),
|
||||
getGcodePreviewHandlerChangeSet(installationDir, PER_USER),
|
||||
getSvgThumbnailHandlerChangeSet(installationDir, PER_USER),
|
||||
getGcodeThumbnailHandlerChangeSet(installationDir, PER_USER),
|
||||
getStlThumbnailHandlerChangeSet(installationDir, PER_USER) };
|
||||
}
|
||||
|
||||
inline std::vector<registry::ChangeSet> getAllModulesChangeSets(const std::wstring installationDir)
|
||||
@@ -111,9 +218,11 @@ inline std::vector<registry::ChangeSet> getAllModulesChangeSets(const std::wstri
|
||||
constexpr bool PER_USER = true;
|
||||
return { getSvgPreviewHandlerChangeSet(installationDir, PER_USER),
|
||||
getMdPreviewHandlerChangeSet(installationDir, PER_USER),
|
||||
getMonacoPreviewHandlerChangeSet(installationDir, PER_USER),
|
||||
getPdfPreviewHandlerChangeSet(installationDir, PER_USER),
|
||||
getGcodePreviewHandlerChangeSet(installationDir, PER_USER),
|
||||
getSvgThumbnailHandlerChangeSet(installationDir, PER_USER),
|
||||
getPdfThumbnailHandlerChangeSet(installationDir, PER_USER),
|
||||
getGcodeThumbnailHandlerChangeSet(installationDir, PER_USER) };
|
||||
}
|
||||
getGcodeThumbnailHandlerChangeSet(installationDir, PER_USER),
|
||||
getStlThumbnailHandlerChangeSet(installationDir, PER_USER) };
|
||||
}
|
||||
|
||||
@@ -69,9 +69,10 @@ namespace registry
|
||||
std::wstring path;
|
||||
std::optional<std::wstring> name; // none == default
|
||||
value_t value;
|
||||
bool required = true;
|
||||
|
||||
ValueChange(const HKEY scope, std::wstring path, std::optional<std::wstring> name, value_t value) :
|
||||
scope{ scope }, path{ std::move(path) }, name{ std::move(name) }, value{ std::move(value) }
|
||||
ValueChange(const HKEY scope, std::wstring path, std::optional<std::wstring> name, value_t value, bool required = true) :
|
||||
scope{ scope }, path{ std::move(path) }, name{ std::move(name) }, value{ std::move(value) }, required{ required }
|
||||
{
|
||||
}
|
||||
|
||||
@@ -268,7 +269,7 @@ namespace registry
|
||||
{
|
||||
for (const auto& c : changes)
|
||||
{
|
||||
if (!c.isApplied())
|
||||
if (c.required && !c.isApplied())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -281,7 +282,7 @@ namespace registry
|
||||
bool ok = true;
|
||||
for (const auto& c : changes)
|
||||
{
|
||||
ok = c.apply() && ok;
|
||||
ok = (c.apply()||!c.required) && ok;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
@@ -291,7 +292,7 @@ namespace registry
|
||||
bool ok = true;
|
||||
for (const auto& c : changes)
|
||||
{
|
||||
ok = c.unApply() && ok;
|
||||
ok = (c.unApply()||!c.required) && ok;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
@@ -317,7 +318,8 @@ namespace registry
|
||||
std::wstring handlerCategory,
|
||||
std::wstring className,
|
||||
std::wstring displayName,
|
||||
std::wstring fileType)
|
||||
std::vector<std::wstring> fileTypes,
|
||||
std::wstring fileKindType = L"" )
|
||||
{
|
||||
const HKEY scope = perUser ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE;
|
||||
|
||||
@@ -350,11 +352,6 @@ namespace registry
|
||||
versionPath += L'\\';
|
||||
versionPath += powertoysVersion;
|
||||
|
||||
std::wstring fileAssociationPath = L"Software\\Classes\\";
|
||||
fileAssociationPath += fileType;
|
||||
fileAssociationPath += L"\\shellex\\";
|
||||
fileAssociationPath += handlerType == PreviewHandlerType::preview ? IPREVIEW_HANDLER_CLSID : ITHUMBNAIL_PROVIDER_CLSID;
|
||||
|
||||
using vec_t = std::vector<registry::ValueChange>;
|
||||
// TODO: verify that we actually need all of those
|
||||
vec_t changes = { { scope, clsidPath, L"DisplayName", displayName },
|
||||
@@ -365,8 +362,24 @@ namespace registry
|
||||
{ scope, inprocServerPath, L"Class", className },
|
||||
{ scope, inprocServerPath, L"ThreadingModel", L"Both" },
|
||||
{ scope, versionPath, L"Assembly", assemblyKeyValue },
|
||||
{ scope, versionPath, L"Class", className },
|
||||
{ scope, fileAssociationPath, std::nullopt, handlerClsid } };
|
||||
{ scope, versionPath, L"Class", className } };
|
||||
|
||||
for (const auto& fileType : fileTypes)
|
||||
{
|
||||
std::wstring fileAssociationPath = L"Software\\Classes\\";
|
||||
fileAssociationPath += fileType;
|
||||
fileAssociationPath += L"\\shellex\\";
|
||||
fileAssociationPath += handlerType == PreviewHandlerType::preview ? IPREVIEW_HANDLER_CLSID : ITHUMBNAIL_PROVIDER_CLSID;
|
||||
changes.push_back({ scope, fileAssociationPath, std::nullopt, handlerClsid });
|
||||
if (!fileKindType.empty())
|
||||
{
|
||||
// Registering a file type as a kind needs to be done at the HKEY_LOCAL_MACHINE level.
|
||||
// Make it optional as well so that we don't fail registering the handler if we can't write to HKEY_LOCAL_MACHINE.
|
||||
std::wstring kindMapPath = L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\KindMap";
|
||||
changes.push_back({ HKEY_LOCAL_MACHINE, kindMapPath, fileType, fileKindType, false});
|
||||
}
|
||||
}
|
||||
|
||||
if (handlerType == PreviewHandlerType::preview)
|
||||
{
|
||||
const std::wstring previewHostClsid = L"{6d2b5079-2f0b-48dd-ab7f-97cec514d30b}";
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#define PRODUCT_VERSION_STRING FILE_VERSION_STRING
|
||||
|
||||
#define COMPANY_NAME "Microsoft Corporation"
|
||||
#define COPYRIGHT_NOTE "Copyright (C) 2020 Microsoft Corporation"
|
||||
#define COPYRIGHT_NOTE "Copyright (C) 2022 Microsoft Corporation"
|
||||
#define PRODUCT_NAME "PowerToys"
|
||||
|
||||
#include <string>
|
||||
|
||||
@@ -21,6 +21,12 @@
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
|
||||
@@ -14,6 +14,12 @@
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Target Name="GenerateResourceFiles" BeforeTargets="PrepareForBuild">
|
||||
<Exec Command="powershell -NonInteractive -executionpolicy Unrestricted $(SolutionDir)tools\build\convert-resx-to-rc.ps1 .\ resource.base.h resource.h FindMyMouse.base.rc FindMyMouse.rc" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -4,6 +4,9 @@
|
||||
#include "FindMyMouse.h"
|
||||
#include "trace.h"
|
||||
#include "common/utils/game_mode.h"
|
||||
#include "common/utils/process_path.h"
|
||||
#include "common/utils/excluded_apps.h"
|
||||
#include <vector>
|
||||
|
||||
#ifdef COMPOSITION
|
||||
namespace winrt
|
||||
@@ -43,6 +46,8 @@ protected:
|
||||
void BeforeMoveSonar() {}
|
||||
void AfterMoveSonar() {}
|
||||
void SetSonarVisibility(bool visible) = delete;
|
||||
void UpdateMouseSnooping();
|
||||
bool IsForegroundAppExcluded();
|
||||
|
||||
protected:
|
||||
// Base class members you can access.
|
||||
@@ -57,22 +62,49 @@ protected:
|
||||
static const int MIN_DOUBLE_CLICK_TIME = 100;
|
||||
|
||||
bool m_destroyed = false;
|
||||
bool m_doNotActivateOnGameMode = true;
|
||||
FindMyMouseActivationMethod m_activationMethod = FIND_MY_MOUSE_DEFAULT_ACTIVATION_METHOD;
|
||||
bool m_doNotActivateOnGameMode = FIND_MY_MOUSE_DEFAULT_DO_NOT_ACTIVATE_ON_GAME_MODE;
|
||||
int m_sonarRadius = FIND_MY_MOUSE_DEFAULT_SPOTLIGHT_RADIUS;
|
||||
int m_sonarZoomFactor = FIND_MY_MOUSE_DEFAULT_SPOTLIGHT_INITIAL_ZOOM;
|
||||
DWORD m_fadeDuration = FIND_MY_MOUSE_DEFAULT_ANIMATION_DURATION_MS;
|
||||
int m_finalAlphaNumerator = FIND_MY_MOUSE_DEFAULT_OVERLAY_OPACITY;
|
||||
std::vector<std::wstring> m_excludedApps;
|
||||
int m_shakeMinimumDistance = FIND_MY_MOUSE_DEFAULT_SHAKE_MINIMUM_DISTANCE;
|
||||
static constexpr int FinalAlphaDenominator = 100;
|
||||
winrt::DispatcherQueueController m_dispatcherQueueController{ nullptr };
|
||||
|
||||
private:
|
||||
|
||||
// Save the mouse movement that occurred in any direction.
|
||||
struct PointerRecentMovement
|
||||
{
|
||||
POINT diff;
|
||||
ULONGLONG tick;
|
||||
};
|
||||
std::vector<PointerRecentMovement> m_movementHistory;
|
||||
// Raw Input may give relative or absolute values. Need to take each case into account.
|
||||
bool m_seenAnAbsoluteMousePosition = false;
|
||||
POINT m_lastAbsolutePosition = { 0, 0 };
|
||||
// Don't consider movements started past these milliseconds to detect shaking.
|
||||
static constexpr LONG ShakeIntervalMs = 1000;
|
||||
// By which factor must travelled distance be than the diagonal of the rectangle containing the movements.
|
||||
static constexpr float ShakeFactor = 4.0f;
|
||||
|
||||
static inline byte GetSign(LONG const& num)
|
||||
{
|
||||
if (num > 0)
|
||||
return 1;
|
||||
if (num < 0)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool IsEqual(POINT const& p1, POINT const& p2)
|
||||
{
|
||||
return p1.x == p2.x && p1.y == p2.y;
|
||||
}
|
||||
|
||||
static constexpr POINT ptNowhere = { -1, -1 };
|
||||
|
||||
static constexpr DWORD TIMER_ID_TRACK = 100;
|
||||
static constexpr DWORD IdlePeriod = 1000;
|
||||
|
||||
@@ -89,11 +121,11 @@ private:
|
||||
HWND m_hwndOwner;
|
||||
SonarState m_sonarState = SonarState::Idle;
|
||||
POINT m_lastKeyPos{};
|
||||
DWORD m_lastKeyTime{};
|
||||
ULONGLONG m_lastKeyTime{};
|
||||
|
||||
static constexpr DWORD NoSonar = 0;
|
||||
static constexpr DWORD SonarWaitingForMouseMove = 1;
|
||||
DWORD m_sonarStart = NoSonar;
|
||||
ULONGLONG m_sonarStart = NoSonar;
|
||||
bool m_isSnoopingMouse = false;
|
||||
|
||||
private:
|
||||
@@ -110,10 +142,10 @@ private:
|
||||
void OnSonarMouseInput(RAWINPUT const& input);
|
||||
void OnMouseTimer();
|
||||
|
||||
void DetectShake();
|
||||
|
||||
void StartSonar();
|
||||
void StopSonar();
|
||||
|
||||
void UpdateMouseSnooping();
|
||||
};
|
||||
|
||||
template<typename D>
|
||||
@@ -189,7 +221,9 @@ LRESULT SuperSonar<D>::BaseWndProc(UINT message, WPARAM wParam, LPARAM lParam) n
|
||||
switch (message)
|
||||
{
|
||||
case WM_CREATE:
|
||||
return OnSonarCreate() ? 0 : -1;
|
||||
if(!OnSonarCreate()) return -1;
|
||||
UpdateMouseSnooping();
|
||||
return 0;
|
||||
|
||||
case WM_DESTROY:
|
||||
OnSonarDestroy();
|
||||
@@ -257,13 +291,7 @@ void SuperSonar<D>::OnSonarInput(WPARAM flags, HRAWINPUT hInput)
|
||||
template<typename D>
|
||||
void SuperSonar<D>::OnSonarKeyboardInput(RAWINPUT const& input)
|
||||
{
|
||||
// Don't activate if game mode is on.
|
||||
if (m_doNotActivateOnGameMode && detect_game_mode())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (input.data.keyboard.VKey != VK_CONTROL)
|
||||
if ( m_activationMethod != FindMyMouseActivationMethod::DoubleControlKey || input.data.keyboard.VKey != VK_CONTROL)
|
||||
{
|
||||
StopSonar();
|
||||
return;
|
||||
@@ -293,7 +321,7 @@ void SuperSonar<D>::OnSonarKeyboardInput(RAWINPUT const& input)
|
||||
if (pressed)
|
||||
{
|
||||
m_sonarState = SonarState::ControlDown1;
|
||||
m_lastKeyTime = GetTickCount();
|
||||
m_lastKeyTime = GetTickCount64();
|
||||
m_lastKeyPos = {};
|
||||
GetCursorPos(&m_lastKeyPos);
|
||||
UpdateMouseSnooping();
|
||||
@@ -310,7 +338,7 @@ void SuperSonar<D>::OnSonarKeyboardInput(RAWINPUT const& input)
|
||||
case SonarState::ControlUp1:
|
||||
if (pressed)
|
||||
{
|
||||
auto now = GetTickCount();
|
||||
auto now = GetTickCount64();
|
||||
auto doubleClickInterval = now - m_lastKeyTime;
|
||||
POINT ptCursor{};
|
||||
auto doubleClickTimeSetting = GetDoubleClickTime();
|
||||
@@ -325,7 +353,7 @@ void SuperSonar<D>::OnSonarKeyboardInput(RAWINPUT const& input)
|
||||
else
|
||||
{
|
||||
m_sonarState = SonarState::ControlDown1;
|
||||
m_lastKeyTime = GetTickCount();
|
||||
m_lastKeyTime = GetTickCount64();
|
||||
m_lastKeyPos = {};
|
||||
GetCursorPos(&m_lastKeyPos);
|
||||
UpdateMouseSnooping();
|
||||
@@ -351,9 +379,97 @@ void SuperSonar<D>::OnSonarKeyboardInput(RAWINPUT const& input)
|
||||
}
|
||||
}
|
||||
|
||||
// Shaking detection algorithm is: Has distance travelled been much greater than the diagonal of the rectangle containing the movement?
|
||||
template<typename D>
|
||||
void SuperSonar<D>::DetectShake()
|
||||
{
|
||||
ULONGLONG shakeStartTick = GetTickCount64() - ShakeIntervalMs;
|
||||
|
||||
// Prune the story of movements for those movements that started too long ago.
|
||||
std::erase_if(m_movementHistory, [shakeStartTick](const PointerRecentMovement& movement) { return movement.tick < shakeStartTick; });
|
||||
|
||||
|
||||
double distanceTravelled = 0;
|
||||
LONGLONG currentX=0, minX=0, maxX=0;
|
||||
LONGLONG currentY=0, minY=0, maxY=0;
|
||||
|
||||
for (const PointerRecentMovement& movement : m_movementHistory)
|
||||
{
|
||||
currentX += movement.diff.x;
|
||||
currentY += movement.diff.y;
|
||||
distanceTravelled += sqrt((double)movement.diff.x * movement.diff.x + (double)movement.diff.y * movement.diff.y); // Pythagorean theorem
|
||||
minX = min(currentX, minX);
|
||||
maxX = max(currentX, maxX);
|
||||
minY = min(currentY, minY);
|
||||
maxY = max(currentY, maxY);
|
||||
}
|
||||
|
||||
if (distanceTravelled < m_shakeMinimumDistance)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Size of the rectangle the pointer moved in.
|
||||
double rectangleWidth = (double)maxX - minX;
|
||||
double rectangleHeight = (double)maxY - minY;
|
||||
|
||||
double diagonal = sqrt(rectangleWidth * rectangleWidth + rectangleHeight * rectangleHeight);
|
||||
if (diagonal > 0 && distanceTravelled / diagonal > ShakeFactor)
|
||||
{
|
||||
m_movementHistory.clear();
|
||||
StartSonar();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
template<typename D>
|
||||
void SuperSonar<D>::OnSonarMouseInput(RAWINPUT const& input)
|
||||
{
|
||||
if (m_activationMethod == FindMyMouseActivationMethod::ShakeMouse)
|
||||
{
|
||||
LONG relativeX = 0;
|
||||
LONG relativeY = 0;
|
||||
if ((input.data.mouse.usFlags & MOUSE_MOVE_ABSOLUTE) == MOUSE_MOVE_ABSOLUTE && (input.data.mouse.lLastX!=0 || input.data.mouse.lLastY!=0))
|
||||
{
|
||||
// Getting absolute mouse coordinates. Likely inside a VM / RDP session.
|
||||
if (m_seenAnAbsoluteMousePosition)
|
||||
{
|
||||
relativeX = input.data.mouse.lLastX - m_lastAbsolutePosition.x;
|
||||
relativeY = input.data.mouse.lLastY - m_lastAbsolutePosition.y;
|
||||
m_lastAbsolutePosition.x = input.data.mouse.lLastX;
|
||||
m_lastAbsolutePosition.y = input.data.mouse.lLastY;
|
||||
}
|
||||
m_seenAnAbsoluteMousePosition = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
relativeX = input.data.mouse.lLastX;
|
||||
relativeY = input.data.mouse.lLastY;
|
||||
}
|
||||
if (m_movementHistory.size() > 0)
|
||||
{
|
||||
PointerRecentMovement& lastMovement = m_movementHistory.back();
|
||||
// If the pointer is still moving in the same direction, just add to that movement instead of adding a new movement.
|
||||
// This helps in keeping the list of movements smaller even in cases where a high number of messages is sent.
|
||||
if (GetSign(lastMovement.diff.x) == GetSign(relativeX) && GetSign(lastMovement.diff.y) == GetSign(relativeY))
|
||||
{
|
||||
lastMovement.diff.x += relativeX;
|
||||
lastMovement.diff.y += relativeY;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_movementHistory.push_back({ .diff = { .x=relativeX, .y=relativeY }, .tick = GetTickCount64() });
|
||||
// Mouse movement changed directions. Take the opportunity do detect shake.
|
||||
DetectShake();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_movementHistory.push_back({ .diff = { .x = relativeX, .y = relativeY }, .tick = GetTickCount64() });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (input.data.mouse.usButtonFlags)
|
||||
{
|
||||
StopSonar();
|
||||
@@ -367,10 +483,22 @@ void SuperSonar<D>::OnSonarMouseInput(RAWINPUT const& input)
|
||||
template<typename D>
|
||||
void SuperSonar<D>::StartSonar()
|
||||
{
|
||||
// Don't activate if game mode is on.
|
||||
if (m_doNotActivateOnGameMode && detect_game_mode())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (IsForegroundAppExcluded())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Logger::info("Focusing the sonar on the mouse cursor.");
|
||||
Trace::MousePointerFocused();
|
||||
// Cover the entire virtual screen.
|
||||
SetWindowPos(m_hwnd, HWND_TOPMOST, GetSystemMetrics(SM_XVIRTUALSCREEN), GetSystemMetrics(SM_YVIRTUALSCREEN), GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN), 0);
|
||||
// HACK: Draw with 1 pixel off. Otherwise Windows glitches the task bar transparency when a transparent window fill the whole screen.
|
||||
SetWindowPos(m_hwnd, HWND_TOPMOST, GetSystemMetrics(SM_XVIRTUALSCREEN), GetSystemMetrics(SM_YVIRTUALSCREEN), GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN)-1, 0);
|
||||
m_sonarPos = ptNowhere;
|
||||
OnMouseTimer();
|
||||
UpdateMouseSnooping();
|
||||
@@ -393,7 +521,7 @@ void SuperSonar<D>::StopSonar()
|
||||
template<typename D>
|
||||
void SuperSonar<D>::OnMouseTimer()
|
||||
{
|
||||
auto now = GetTickCount();
|
||||
auto now = GetTickCount64();
|
||||
|
||||
// If mouse has moved, then reset the sonar timer.
|
||||
POINT ptCursor{};
|
||||
@@ -433,7 +561,7 @@ void SuperSonar<D>::OnMouseTimer()
|
||||
template<typename D>
|
||||
void SuperSonar<D>::UpdateMouseSnooping()
|
||||
{
|
||||
bool wantSnoopingMouse = m_sonarStart != NoSonar || m_sonarState != SonarState::Idle;
|
||||
bool wantSnoopingMouse = m_sonarStart != NoSonar || m_sonarState != SonarState::Idle || m_activationMethod == FindMyMouseActivationMethod::ShakeMouse;
|
||||
if (m_isSnoopingMouse != wantSnoopingMouse)
|
||||
{
|
||||
m_isSnoopingMouse = wantSnoopingMouse;
|
||||
@@ -454,6 +582,25 @@ void SuperSonar<D>::UpdateMouseSnooping()
|
||||
}
|
||||
}
|
||||
|
||||
template<typename D>
|
||||
bool SuperSonar<D>::IsForegroundAppExcluded()
|
||||
{
|
||||
if (m_excludedApps.size() < 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (HWND foregroundApp{ GetForegroundWindow() })
|
||||
{
|
||||
auto processPath = get_process_path(foregroundApp);
|
||||
CharUpperBuffW(processPath.data(), (DWORD)processPath.length());
|
||||
return find_app_name_in_path(processPath, m_excludedApps);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
struct CompositionSpotlight : SuperSonar<CompositionSpotlight>
|
||||
{
|
||||
static constexpr UINT WM_OPACITY_ANIMATION_COMPLETED = WM_APP;
|
||||
@@ -590,14 +737,23 @@ public:
|
||||
m_sonarRadiusFloat = static_cast<float>(m_sonarRadius);
|
||||
m_backgroundColor = settings.backgroundColor;
|
||||
m_spotlightColor = settings.spotlightColor;
|
||||
m_activationMethod = settings.activationMethod;
|
||||
m_doNotActivateOnGameMode = settings.doNotActivateOnGameMode;
|
||||
m_fadeDuration = settings.animationDurationMs > 0 ? settings.animationDurationMs : 1;
|
||||
m_finalAlphaNumerator = settings.overlayOpacity;
|
||||
m_sonarZoomFactor = settings.spotlightInitialZoom;
|
||||
m_excludedApps = settings.excludedApps;
|
||||
m_shakeMinimumDistance = settings.shakeMinimumDistance;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Runtime objects already created. Should update in the owner thread.
|
||||
if (m_dispatcherQueueController == nullptr)
|
||||
{
|
||||
Logger::warn("Tried accessing the dispatch queue controller before it was initialized.");
|
||||
// No dispatcher Queue Controller? Means initialization still hasn't run, so settings will be applied then.
|
||||
return;
|
||||
}
|
||||
auto dispatcherQueue = m_dispatcherQueueController.DispatcherQueue();
|
||||
FindMyMouseSettings localSettings = settings;
|
||||
bool enqueueSucceeded = dispatcherQueue.TryEnqueue([=]() {
|
||||
@@ -608,11 +764,15 @@ public:
|
||||
m_sonarRadiusFloat = static_cast<float>(m_sonarRadius);
|
||||
m_backgroundColor = localSettings.backgroundColor;
|
||||
m_spotlightColor = localSettings.spotlightColor;
|
||||
m_activationMethod = localSettings.activationMethod;
|
||||
m_doNotActivateOnGameMode = localSettings.doNotActivateOnGameMode;
|
||||
m_fadeDuration = localSettings.animationDurationMs > 0 ? localSettings.animationDurationMs : 1;
|
||||
m_finalAlphaNumerator = localSettings.overlayOpacity;
|
||||
m_sonarZoomFactor = localSettings.spotlightInitialZoom;
|
||||
|
||||
m_excludedApps = localSettings.excludedApps;
|
||||
m_shakeMinimumDistance = localSettings.shakeMinimumDistance;
|
||||
UpdateMouseSnooping(); // For the shake mouse activation method
|
||||
|
||||
// Apply new settings to runtime composition objects.
|
||||
m_backdrop.Brush().as<winrt::CompositionColorBrush>().Color(m_backgroundColor);
|
||||
m_circleShape.FillBrush().as<winrt::CompositionColorBrush>().Color(m_spotlightColor);
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
#pragma once
|
||||
#include "pch.h"
|
||||
|
||||
enum struct FindMyMouseActivationMethod : int
|
||||
{
|
||||
DoubleControlKey = 0,
|
||||
ShakeMouse = 1,
|
||||
EnumElements = 2, // number of elements in the enum, not counting this
|
||||
};
|
||||
|
||||
constexpr bool FIND_MY_MOUSE_DEFAULT_DO_NOT_ACTIVATE_ON_GAME_MODE = true;
|
||||
const winrt::Windows::UI::Color FIND_MY_MOUSE_DEFAULT_BACKGROUND_COLOR = winrt::Windows::UI::ColorHelper::FromArgb(255, 0, 0, 0);
|
||||
const winrt::Windows::UI::Color FIND_MY_MOUSE_DEFAULT_SPOTLIGHT_COLOR = winrt::Windows::UI::ColorHelper::FromArgb(255, 255, 255, 255);
|
||||
@@ -8,9 +15,12 @@ constexpr int FIND_MY_MOUSE_DEFAULT_OVERLAY_OPACITY = 50;
|
||||
constexpr int FIND_MY_MOUSE_DEFAULT_SPOTLIGHT_RADIUS = 100;
|
||||
constexpr int FIND_MY_MOUSE_DEFAULT_ANIMATION_DURATION_MS = 500;
|
||||
constexpr int FIND_MY_MOUSE_DEFAULT_SPOTLIGHT_INITIAL_ZOOM = 9;
|
||||
constexpr FindMyMouseActivationMethod FIND_MY_MOUSE_DEFAULT_ACTIVATION_METHOD = FindMyMouseActivationMethod::DoubleControlKey;
|
||||
constexpr int FIND_MY_MOUSE_DEFAULT_SHAKE_MINIMUM_DISTANCE = 1000;
|
||||
|
||||
struct FindMyMouseSettings
|
||||
{
|
||||
FindMyMouseActivationMethod activationMethod = FIND_MY_MOUSE_DEFAULT_ACTIVATION_METHOD;
|
||||
bool doNotActivateOnGameMode = FIND_MY_MOUSE_DEFAULT_DO_NOT_ACTIVATE_ON_GAME_MODE;
|
||||
winrt::Windows::UI::Color backgroundColor = FIND_MY_MOUSE_DEFAULT_BACKGROUND_COLOR;
|
||||
winrt::Windows::UI::Color spotlightColor = FIND_MY_MOUSE_DEFAULT_SPOTLIGHT_COLOR;
|
||||
@@ -18,6 +28,8 @@ struct FindMyMouseSettings
|
||||
int spotlightRadius = FIND_MY_MOUSE_DEFAULT_SPOTLIGHT_RADIUS;
|
||||
int animationDurationMs = FIND_MY_MOUSE_DEFAULT_ANIMATION_DURATION_MS;
|
||||
int spotlightInitialZoom = FIND_MY_MOUSE_DEFAULT_SPOTLIGHT_INITIAL_ZOOM;
|
||||
int shakeMinimumDistance = FIND_MY_MOUSE_DEFAULT_SHAKE_MINIMUM_DISTANCE;
|
||||
std::vector<std::wstring> excludedApps;
|
||||
};
|
||||
|
||||
int FindMyMouseMain(HINSTANCE hinst, const FindMyMouseSettings& settings);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <windows.h>
|
||||
#include "resource.h"
|
||||
#include "../../../../common/version/version.h"
|
||||
#include "../../../common/version/version.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
#include "winres.h"
|
||||
@@ -24,13 +24,13 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
@@ -106,8 +106,7 @@
|
||||
<ItemGroup>
|
||||
<ClInclude Include="FindMyMouse.h" />
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="Generated Files\resource.h" />
|
||||
<None Include="resource.base.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
<ClInclude Include="trace.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -117,7 +116,6 @@
|
||||
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="trace.cpp" />
|
||||
<None Include="FindMyMouse.base.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\common\logger\logger.vcxproj">
|
||||
@@ -128,7 +126,7 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Generated Files\FindMyMouse.rc" />
|
||||
<ResourceCompile Include="FindMyMouse.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
|
||||
@@ -41,22 +41,16 @@
|
||||
<ClInclude Include="FindMyMouse.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Generated Files\resource.h">
|
||||
<Filter>Generated Files</Filter>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="resource.base.h">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="FindMyMouse.base.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Generated Files\FindMyMouse.rc">
|
||||
<Filter>Generated Files</Filter>
|
||||
<ResourceCompile Include="FindMyMouse.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -6,11 +6,13 @@
|
||||
#include <thread>
|
||||
#include <common/utils/logger_helper.h>
|
||||
#include <common/utils/color.h>
|
||||
#include <common/utils/string_utils.h>
|
||||
|
||||
namespace
|
||||
{
|
||||
const wchar_t JSON_KEY_PROPERTIES[] = L"properties";
|
||||
const wchar_t JSON_KEY_VALUE[] = L"value";
|
||||
const wchar_t JSON_KEY_ACTIVATION_METHOD[] = L"activation_method";
|
||||
const wchar_t JSON_KEY_DO_NOT_ACTIVATE_ON_GAME_MODE[] = L"do_not_activate_on_game_mode";
|
||||
const wchar_t JSON_KEY_BACKGROUND_COLOR[] = L"background_color";
|
||||
const wchar_t JSON_KEY_SPOTLIGHT_COLOR[] = L"spotlight_color";
|
||||
@@ -18,6 +20,8 @@ namespace
|
||||
const wchar_t JSON_KEY_SPOTLIGHT_RADIUS[] = L"spotlight_radius";
|
||||
const wchar_t JSON_KEY_ANIMATION_DURATION_MS[] = L"animation_duration_ms";
|
||||
const wchar_t JSON_KEY_SPOTLIGHT_INITIAL_ZOOM[] = L"spotlight_initial_zoom";
|
||||
const wchar_t JSON_KEY_EXCLUDED_APPS[] = L"excluded_apps";
|
||||
const wchar_t JSON_KEY_SHAKING_MINIMUM_DISTANCE[] = L"shaking_minimum_distance";
|
||||
}
|
||||
|
||||
extern "C" IMAGE_DOS_HEADER __ImageBase;
|
||||
@@ -171,6 +175,20 @@ void FindMyMouse::parse_settings(PowerToysSettings::PowerToyValues& settings)
|
||||
FindMyMouseSettings findMyMouseSettings;
|
||||
if (settingsObject.GetView().Size())
|
||||
{
|
||||
try
|
||||
{
|
||||
// Parse Activation Method
|
||||
auto jsonPropertiesObject = settingsObject.GetNamedObject(JSON_KEY_PROPERTIES).GetNamedObject(JSON_KEY_ACTIVATION_METHOD);
|
||||
UINT value = (UINT)jsonPropertiesObject.GetNamedNumber(JSON_KEY_VALUE);
|
||||
if (value < (int)FindMyMouseActivationMethod::EnumElements)
|
||||
{
|
||||
findMyMouseSettings.activationMethod = (FindMyMouseActivationMethod)value;
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
Logger::warn("Failed to initialize Activation Method from settings. Will use default value");
|
||||
}
|
||||
try
|
||||
{
|
||||
auto jsonPropertiesObject = settingsObject.GetNamedObject(JSON_KEY_PROPERTIES).GetNamedObject(JSON_KEY_DO_NOT_ACTIVATE_ON_GAME_MODE);
|
||||
@@ -258,6 +276,41 @@ void FindMyMouse::parse_settings(PowerToysSettings::PowerToyValues& settings)
|
||||
{
|
||||
Logger::warn("Failed to initialize Spotlight Initial Zoom from settings. Will use default value");
|
||||
}
|
||||
try
|
||||
{
|
||||
// Parse Excluded Apps
|
||||
auto jsonPropertiesObject = settingsObject.GetNamedObject(JSON_KEY_PROPERTIES).GetNamedObject(JSON_KEY_EXCLUDED_APPS);
|
||||
std::wstring apps = jsonPropertiesObject.GetNamedString(JSON_KEY_VALUE).c_str();
|
||||
std::vector<std::wstring> excludedApps;
|
||||
auto excludedUppercase = apps;
|
||||
CharUpperBuffW(excludedUppercase.data(), (DWORD)excludedUppercase.length());
|
||||
std::wstring_view view(excludedUppercase);
|
||||
view = left_trim<wchar_t>(trim<wchar_t>(view));
|
||||
|
||||
while (!view.empty())
|
||||
{
|
||||
auto pos = (std::min)(view.find_first_of(L"\r\n"), view.length());
|
||||
excludedApps.emplace_back(view.substr(0, pos));
|
||||
view.remove_prefix(pos);
|
||||
view = left_trim<wchar_t>(trim<wchar_t>(view));
|
||||
}
|
||||
|
||||
findMyMouseSettings.excludedApps = excludedApps;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
Logger::warn("Failed to initialize Excluded Apps from settings. Will use default value");
|
||||
}
|
||||
try
|
||||
{
|
||||
// Parse Shaking Minimum Distance
|
||||
auto jsonPropertiesObject = settingsObject.GetNamedObject(JSON_KEY_PROPERTIES).GetNamedObject(JSON_KEY_SHAKING_MINIMUM_DISTANCE);
|
||||
findMyMouseSettings.shakeMinimumDistance = (UINT)jsonPropertiesObject.GetNamedNumber(JSON_KEY_VALUE);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
Logger::warn("Failed to initialize Shaking Minimum Distance from settings. Will use default value");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#define FILE_DESCRIPTION "PowerToys FindMyMouse"
|
||||
#define INTERNAL_NAME "PowerToys.FindMyMouse"
|
||||
#define ORIGINAL_FILENAME "PowerToys.FindMyMouse.dll"
|
||||
#define IDS_KEYBOARDMANAGER_ICON 1001
|
||||
|
||||
// Non-localizable
|
||||
//////////////////////////////
|
||||
@@ -1,5 +0,0 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Target Name="GenerateResourceFiles" BeforeTargets="PrepareForBuild">
|
||||
<Exec Command="powershell -NonInteractive -executionpolicy Unrestricted $(SolutionDir)tools\build\convert-resx-to-rc.ps1 .\ resource.base.h resource.h MouseHighlighter.base.rc MouseHighlighter.rc" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -150,8 +150,9 @@ void Highlighter::AddDrawingPoint(MouseButton button)
|
||||
// Perhaps add a task to the Dispatcher every X circles to clean up.
|
||||
|
||||
// Get back on top in case other Window is now the topmost.
|
||||
// HACK: Draw with 1 pixel off. Otherwise Windows glitches the task bar transparency when a transparent window fill the whole screen.
|
||||
SetWindowPos(m_hwnd, HWND_TOPMOST, GetSystemMetrics(SM_XVIRTUALSCREEN), GetSystemMetrics(SM_YVIRTUALSCREEN),
|
||||
GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN), 0);
|
||||
GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN)-1, 0);
|
||||
}
|
||||
|
||||
void Highlighter::UpdateDrawingPointPosition(MouseButton button)
|
||||
@@ -259,8 +260,10 @@ void Highlighter::StartDrawing()
|
||||
Logger::info("Starting draw mode.");
|
||||
Trace::StartHighlightingSession();
|
||||
m_visible = true;
|
||||
|
||||
// HACK: Draw with 1 pixel off. Otherwise Windows glitches the task bar transparency when a transparent window fill the whole screen.
|
||||
SetWindowPos(m_hwnd, HWND_TOPMOST, GetSystemMetrics(SM_XVIRTUALSCREEN), GetSystemMetrics(SM_YVIRTUALSCREEN),
|
||||
GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN), 0);
|
||||
GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN)-1, 0);
|
||||
ClearDrawing();
|
||||
ShowWindow(m_hwnd, SW_SHOWNOACTIVATE);
|
||||
m_mouseHook = SetWindowsHookEx(WH_MOUSE_LL, MouseHookProc, m_hinstance, 0);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <windows.h>
|
||||
#include "resource.h"
|
||||
#include "../../../../common/version/version.h"
|
||||
#include "../../../common/version/version.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
#include "winres.h"
|
||||
@@ -23,13 +23,13 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
@@ -106,8 +106,7 @@
|
||||
<ClInclude Include="MouseHighlighter.h" />
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="trace.h" />
|
||||
<ClInclude Include="Generated Files\resource.h" />
|
||||
<None Include="resource.base.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="dllmain.cpp" />
|
||||
@@ -116,13 +115,12 @@
|
||||
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="trace.cpp" />
|
||||
<None Include="MouseHighlighter.base.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Generated Files\MouseHighlighter.rc" />
|
||||
<ResourceCompile Include="MouseHighlighter.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\common\logger\logger.vcxproj">
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
<ClInclude Include="trace.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Generated Files\resource.h">
|
||||
<Filter>Generated Files</Filter>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MouseHighlighter.h">
|
||||
<Filter>Header Files</Filter>
|
||||
@@ -30,12 +30,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="MouseHighlighter.base.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="resource.base.h">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
@@ -55,8 +49,8 @@
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Generated Files\MouseHighlighter.rc">
|
||||
<Filter>Generated Files</Filter>
|
||||
<ResourceCompile Include="MouseHighlighter.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -8,7 +8,6 @@
|
||||
#define FILE_DESCRIPTION "PowerToys MouseHighlighter"
|
||||
#define INTERNAL_NAME "PowerToys.MouseHighlighter"
|
||||
#define ORIGINAL_FILENAME "PowerToys.MouseHighlighter.dll"
|
||||
#define IDS_KEYBOARDMANAGER_ICON 1001
|
||||
|
||||
// Non-localizable
|
||||
//////////////////////////////
|
||||
@@ -0,0 +1,462 @@
|
||||
// InclusiveCrosshairs.cpp : Defines the entry point for the application.
|
||||
//
|
||||
|
||||
#include "pch.h"
|
||||
#include "InclusiveCrosshairs.h"
|
||||
#include "trace.h"
|
||||
|
||||
#ifdef COMPOSITION
|
||||
namespace winrt
|
||||
{
|
||||
using namespace winrt::Windows::System;
|
||||
using namespace winrt::Windows::UI::Composition;
|
||||
}
|
||||
|
||||
namespace ABI
|
||||
{
|
||||
using namespace ABI::Windows::System;
|
||||
using namespace ABI::Windows::UI::Composition::Desktop;
|
||||
}
|
||||
#endif
|
||||
|
||||
struct InclusiveCrosshairs
|
||||
{
|
||||
bool MyRegisterClass(HINSTANCE hInstance);
|
||||
static InclusiveCrosshairs* instance;
|
||||
void Terminate();
|
||||
void SwitchActivationMode();
|
||||
void ApplySettings(InclusiveCrosshairsSettings& settings, bool applyToRuntimeObjects);
|
||||
|
||||
private:
|
||||
enum class MouseButton
|
||||
{
|
||||
Left,
|
||||
Right
|
||||
};
|
||||
|
||||
void DestroyInclusiveCrosshairs();
|
||||
static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) noexcept;
|
||||
void StartDrawing();
|
||||
void StopDrawing();
|
||||
bool CreateInclusiveCrosshairs();
|
||||
void UpdateCrosshairsPosition();
|
||||
HHOOK m_mouseHook = NULL;
|
||||
static LRESULT CALLBACK MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam) noexcept;
|
||||
|
||||
static constexpr auto m_className = L"MousePointerCrosshairs";
|
||||
static constexpr auto m_windowTitle = L"PowerToys Mouse Pointer Crosshairs";
|
||||
HWND m_hwndOwner = NULL;
|
||||
HWND m_hwnd = NULL;
|
||||
HINSTANCE m_hinstance = NULL;
|
||||
static constexpr DWORD WM_SWITCH_ACTIVATION_MODE = WM_APP;
|
||||
|
||||
winrt::DispatcherQueueController m_dispatcherQueueController{ nullptr };
|
||||
winrt::Compositor m_compositor{ nullptr };
|
||||
winrt::Desktop::DesktopWindowTarget m_target{ nullptr };
|
||||
winrt::ContainerVisual m_root{ nullptr };
|
||||
winrt::LayerVisual m_crosshairs_border_layer{ nullptr };
|
||||
winrt::LayerVisual m_crosshairs_layer{ nullptr };
|
||||
winrt::SpriteVisual m_left_crosshairs_border{ nullptr };
|
||||
winrt::SpriteVisual m_left_crosshairs{ nullptr };
|
||||
winrt::SpriteVisual m_right_crosshairs_border{ nullptr };
|
||||
winrt::SpriteVisual m_right_crosshairs{ nullptr };
|
||||
winrt::SpriteVisual m_top_crosshairs_border{ nullptr };
|
||||
winrt::SpriteVisual m_top_crosshairs{ nullptr };
|
||||
winrt::SpriteVisual m_bottom_crosshairs_border{ nullptr };
|
||||
winrt::SpriteVisual m_bottom_crosshairs{ nullptr };
|
||||
|
||||
bool m_visible = false;
|
||||
bool m_destroyed = false;
|
||||
|
||||
// Configurable Settings
|
||||
winrt::Windows::UI::Color m_crosshairs_border_color = INCLUSIVE_MOUSE_DEFAULT_CROSSHAIRS_BORDER_COLOR;
|
||||
winrt::Windows::UI::Color m_crosshairs_color = INCLUSIVE_MOUSE_DEFAULT_CROSSHAIRS_COLOR;
|
||||
int m_crosshairs_radius = INCLUSIVE_MOUSE_DEFAULT_CROSSHAIRS_RADIUS;
|
||||
int m_crosshairs_thickness = INCLUSIVE_MOUSE_DEFAULT_CROSSHAIRS_THICKNESS;
|
||||
int m_crosshairs_border_size = INCLUSIVE_MOUSE_DEFAULT_CROSSHAIRS_BORDER_SIZE;
|
||||
float m_crosshairs_opacity = max(0.f, min(1.f, (float)INCLUSIVE_MOUSE_DEFAULT_CROSSHAIRS_OPACITY / 100.0f));
|
||||
};
|
||||
|
||||
InclusiveCrosshairs* InclusiveCrosshairs::instance = nullptr;
|
||||
|
||||
bool InclusiveCrosshairs::CreateInclusiveCrosshairs()
|
||||
{
|
||||
try
|
||||
{
|
||||
// We need a dispatcher queue.
|
||||
DispatcherQueueOptions options = {
|
||||
sizeof(options),
|
||||
DQTYPE_THREAD_CURRENT,
|
||||
DQTAT_COM_ASTA,
|
||||
};
|
||||
ABI::IDispatcherQueueController* controller;
|
||||
winrt::check_hresult(CreateDispatcherQueueController(options, &controller));
|
||||
*winrt::put_abi(m_dispatcherQueueController) = controller;
|
||||
|
||||
// Create the compositor for our window.
|
||||
m_compositor = winrt::Compositor();
|
||||
ABI::IDesktopWindowTarget* target;
|
||||
winrt::check_hresult(m_compositor.as<ABI::ICompositorDesktopInterop>()->CreateDesktopWindowTarget(m_hwnd, false, &target));
|
||||
*winrt::put_abi(m_target) = target;
|
||||
|
||||
// Our composition tree:
|
||||
//
|
||||
// [root] ContainerVisual
|
||||
// \ [crosshairs border layer] LayerVisual
|
||||
// \ [crosshairs border sprites]
|
||||
// [crosshairs layer] LayerVisual
|
||||
// \ [crosshairs sprites]
|
||||
|
||||
m_root = m_compositor.CreateContainerVisual();
|
||||
m_root.RelativeSizeAdjustment({ 1.0f, 1.0f });
|
||||
m_target.Root(m_root);
|
||||
|
||||
m_root.Opacity(m_crosshairs_opacity);
|
||||
|
||||
m_crosshairs_border_layer = m_compositor.CreateLayerVisual();
|
||||
m_crosshairs_border_layer.RelativeSizeAdjustment({ 1.0f, 1.0f });
|
||||
m_root.Children().InsertAtTop(m_crosshairs_border_layer);
|
||||
m_crosshairs_border_layer.Opacity(1.0f);
|
||||
|
||||
m_crosshairs_layer = m_compositor.CreateLayerVisual();
|
||||
m_crosshairs_layer.RelativeSizeAdjustment({ 1.0f, 1.0f });
|
||||
|
||||
// Create the crosshairs sprites.
|
||||
m_left_crosshairs_border = m_compositor.CreateSpriteVisual();
|
||||
m_left_crosshairs_border.AnchorPoint({ 1.0f, 0.5f });
|
||||
m_left_crosshairs_border.Brush(m_compositor.CreateColorBrush(m_crosshairs_border_color));
|
||||
m_crosshairs_border_layer.Children().InsertAtTop(m_left_crosshairs_border);
|
||||
m_left_crosshairs = m_compositor.CreateSpriteVisual();
|
||||
m_left_crosshairs.AnchorPoint({ 1.0f, 0.5f });
|
||||
m_left_crosshairs.Brush(m_compositor.CreateColorBrush(m_crosshairs_color));
|
||||
m_crosshairs_layer.Children().InsertAtTop(m_left_crosshairs);
|
||||
|
||||
m_right_crosshairs_border = m_compositor.CreateSpriteVisual();
|
||||
m_right_crosshairs_border.AnchorPoint({ 0.0f, 0.5f });
|
||||
m_right_crosshairs_border.Brush(m_compositor.CreateColorBrush(m_crosshairs_border_color));
|
||||
m_crosshairs_border_layer.Children().InsertAtTop(m_right_crosshairs_border);
|
||||
m_right_crosshairs = m_compositor.CreateSpriteVisual();
|
||||
m_right_crosshairs.AnchorPoint({ 0.0f, 0.5f });
|
||||
m_right_crosshairs.Brush(m_compositor.CreateColorBrush(m_crosshairs_color));
|
||||
m_crosshairs_layer.Children().InsertAtTop(m_right_crosshairs);
|
||||
|
||||
m_top_crosshairs_border = m_compositor.CreateSpriteVisual();
|
||||
m_top_crosshairs_border.AnchorPoint({ 0.5f, 1.0f });
|
||||
m_top_crosshairs_border.Brush(m_compositor.CreateColorBrush(m_crosshairs_border_color));
|
||||
m_crosshairs_border_layer.Children().InsertAtTop(m_top_crosshairs_border);
|
||||
m_top_crosshairs = m_compositor.CreateSpriteVisual();
|
||||
m_top_crosshairs.AnchorPoint({ 0.5f, 1.0f });
|
||||
m_top_crosshairs.Brush(m_compositor.CreateColorBrush(m_crosshairs_color));
|
||||
m_crosshairs_layer.Children().InsertAtTop(m_top_crosshairs);
|
||||
|
||||
m_bottom_crosshairs_border = m_compositor.CreateSpriteVisual();
|
||||
m_bottom_crosshairs_border.AnchorPoint({ 0.5f, 0.0f });
|
||||
m_bottom_crosshairs_border.Brush(m_compositor.CreateColorBrush(m_crosshairs_border_color));
|
||||
m_crosshairs_border_layer.Children().InsertAtTop(m_bottom_crosshairs_border);
|
||||
m_bottom_crosshairs = m_compositor.CreateSpriteVisual();
|
||||
m_bottom_crosshairs.AnchorPoint({ 0.5f, 0.0f });
|
||||
m_bottom_crosshairs.Brush(m_compositor.CreateColorBrush(m_crosshairs_color));
|
||||
m_crosshairs_layer.Children().InsertAtTop(m_bottom_crosshairs);
|
||||
|
||||
m_crosshairs_border_layer.Children().InsertAtTop(m_crosshairs_layer);
|
||||
m_crosshairs_layer.Opacity(1.0f);
|
||||
|
||||
UpdateCrosshairsPosition();
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void InclusiveCrosshairs::UpdateCrosshairsPosition()
|
||||
{
|
||||
POINT ptCursor;
|
||||
|
||||
GetCursorPos(&ptCursor);
|
||||
|
||||
HMONITOR cursorMonitor = MonitorFromPoint(ptCursor, MONITOR_DEFAULTTONEAREST);
|
||||
|
||||
if (cursorMonitor == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MONITORINFO monitorInfo;
|
||||
monitorInfo.cbSize = sizeof(monitorInfo);
|
||||
|
||||
if (!GetMonitorInfo(cursorMonitor, &monitorInfo))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
POINT ptMonitorUpperLeft;
|
||||
ptMonitorUpperLeft.x = monitorInfo.rcMonitor.left;
|
||||
ptMonitorUpperLeft.y = monitorInfo.rcMonitor.top;
|
||||
|
||||
POINT ptMonitorBottomRight;
|
||||
ptMonitorBottomRight.x = monitorInfo.rcMonitor.right;
|
||||
ptMonitorBottomRight.y = monitorInfo.rcMonitor.bottom;
|
||||
|
||||
// Convert everything to client coordinates.
|
||||
ScreenToClient(m_hwnd, &ptCursor);
|
||||
ScreenToClient(m_hwnd, &ptMonitorUpperLeft);
|
||||
ScreenToClient(m_hwnd, &ptMonitorBottomRight);
|
||||
|
||||
// Crosshair position should receive a minor adjustment for odd values to prevent anti-aliasing due to half pixels, while still looking like it's centered around the mouse pointer.
|
||||
float halfPixelAdjustment = m_crosshairs_thickness % 2 == 1 ? 0.5f : 0.0f;
|
||||
|
||||
// Position crosshairs components around the mouse pointer.
|
||||
m_left_crosshairs_border.Offset({ (float)ptCursor.x - m_crosshairs_radius + m_crosshairs_border_size + halfPixelAdjustment * 2, (float)ptCursor.y + halfPixelAdjustment, .0f });
|
||||
m_left_crosshairs_border.Size({ (float)ptCursor.x - (float)ptMonitorUpperLeft.x - m_crosshairs_radius + m_crosshairs_border_size + halfPixelAdjustment * 2, (float)m_crosshairs_thickness + m_crosshairs_border_size * 2 });
|
||||
m_left_crosshairs.Offset({ (float)ptCursor.x - m_crosshairs_radius + halfPixelAdjustment * 2, (float)ptCursor.y + halfPixelAdjustment, .0f });
|
||||
m_left_crosshairs.Size({ (float)ptCursor.x - (float)ptMonitorUpperLeft.x - m_crosshairs_radius + halfPixelAdjustment * 2, (float)m_crosshairs_thickness });
|
||||
|
||||
m_right_crosshairs_border.Offset({ (float)ptCursor.x + m_crosshairs_radius - m_crosshairs_border_size, (float)ptCursor.y + halfPixelAdjustment, .0f });
|
||||
m_right_crosshairs_border.Size({ (float)ptMonitorBottomRight.x - (float)ptCursor.x - m_crosshairs_radius + m_crosshairs_border_size, (float)m_crosshairs_thickness + m_crosshairs_border_size * 2 });
|
||||
m_right_crosshairs.Offset({ (float)ptCursor.x + m_crosshairs_radius, (float)ptCursor.y + halfPixelAdjustment, .0f });
|
||||
m_right_crosshairs.Size({ (float)ptMonitorBottomRight.x - (float)ptCursor.x - m_crosshairs_radius, (float)m_crosshairs_thickness });
|
||||
|
||||
m_top_crosshairs_border.Offset({ (float)ptCursor.x + halfPixelAdjustment, (float)ptCursor.y - m_crosshairs_radius + m_crosshairs_border_size + halfPixelAdjustment * 2, .0f });
|
||||
m_top_crosshairs_border.Size({ (float)m_crosshairs_thickness + m_crosshairs_border_size * 2, (float)ptCursor.y - (float)ptMonitorUpperLeft.y - m_crosshairs_radius + m_crosshairs_border_size + halfPixelAdjustment * 2 });
|
||||
m_top_crosshairs.Offset({ (float)ptCursor.x + halfPixelAdjustment, (float)ptCursor.y - m_crosshairs_radius + halfPixelAdjustment * 2, .0f });
|
||||
m_top_crosshairs.Size({ (float)m_crosshairs_thickness, (float)ptCursor.y - (float)ptMonitorUpperLeft.y - m_crosshairs_radius + halfPixelAdjustment * 2 });
|
||||
|
||||
m_bottom_crosshairs_border.Offset({ (float)ptCursor.x + halfPixelAdjustment, (float)ptCursor.y + m_crosshairs_radius - m_crosshairs_border_size, .0f });
|
||||
m_bottom_crosshairs_border.Size({ (float)m_crosshairs_thickness + m_crosshairs_border_size * 2, (float)ptMonitorBottomRight.y - (float)ptCursor.y - m_crosshairs_radius + m_crosshairs_border_size });
|
||||
m_bottom_crosshairs.Offset({ (float)ptCursor.x + halfPixelAdjustment, (float)ptCursor.y + m_crosshairs_radius, .0f });
|
||||
m_bottom_crosshairs.Size({ (float)m_crosshairs_thickness, (float)ptMonitorBottomRight.y - (float)ptCursor.y - m_crosshairs_radius });
|
||||
|
||||
}
|
||||
|
||||
LRESULT CALLBACK InclusiveCrosshairs::MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam) noexcept
|
||||
{
|
||||
if (nCode >= 0)
|
||||
{
|
||||
MSLLHOOKSTRUCT* hookData = (MSLLHOOKSTRUCT*)lParam;
|
||||
if (wParam == WM_MOUSEMOVE) {
|
||||
instance->UpdateCrosshairsPosition();
|
||||
}
|
||||
}
|
||||
return CallNextHookEx(0, nCode, wParam, lParam);
|
||||
}
|
||||
|
||||
void InclusiveCrosshairs::StartDrawing()
|
||||
{
|
||||
Logger::info("Start drawing crosshairs.");
|
||||
Trace::StartDrawingCrosshairs();
|
||||
// HACK: Draw with 1 pixel off. Otherwise Windows glitches the task bar transparency when a transparent window fill the whole screen.
|
||||
SetWindowPos(m_hwnd, HWND_TOPMOST, GetSystemMetrics(SM_XVIRTUALSCREEN), GetSystemMetrics(SM_YVIRTUALSCREEN), GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN)-1, 0);
|
||||
UpdateCrosshairsPosition();
|
||||
ShowWindow(m_hwnd, SW_SHOWNOACTIVATE);
|
||||
m_visible = true;
|
||||
m_mouseHook = SetWindowsHookEx(WH_MOUSE_LL, MouseHookProc, m_hinstance, 0);
|
||||
}
|
||||
|
||||
void InclusiveCrosshairs::StopDrawing()
|
||||
{
|
||||
Logger::info("Stop drawing crosshairs.");
|
||||
m_visible = false;
|
||||
ShowWindow(m_hwnd, SW_HIDE);
|
||||
UnhookWindowsHookEx(m_mouseHook);
|
||||
m_mouseHook = NULL;
|
||||
}
|
||||
|
||||
void InclusiveCrosshairs::SwitchActivationMode()
|
||||
{
|
||||
PostMessage(m_hwnd, WM_SWITCH_ACTIVATION_MODE, 0, 0);
|
||||
}
|
||||
|
||||
void InclusiveCrosshairs::ApplySettings(InclusiveCrosshairsSettings& settings, bool applyToRunTimeObjects)
|
||||
{
|
||||
m_crosshairs_radius = settings.crosshairsRadius;
|
||||
m_crosshairs_thickness = settings.crosshairsThickness;
|
||||
m_crosshairs_color = settings.crosshairsColor;
|
||||
m_crosshairs_opacity = max(0.f, min(1.f, (float)settings.crosshairsOpacity / 100.0f));
|
||||
m_crosshairs_border_color = settings.crosshairsBorderColor;
|
||||
m_crosshairs_border_size = settings.crosshairsBorderSize;
|
||||
|
||||
if (applyToRunTimeObjects)
|
||||
{
|
||||
// Runtime objects already created. Should update in the owner thread.
|
||||
if (m_dispatcherQueueController == nullptr)
|
||||
{
|
||||
Logger::warn("Tried accessing the dispatch queue controller before it was initialized.");
|
||||
// No dispatcher Queue Controller? Means initialization still hasn't run, so settings will be applied then.
|
||||
return;
|
||||
}
|
||||
auto dispatcherQueue = m_dispatcherQueueController.DispatcherQueue();
|
||||
InclusiveCrosshairsSettings localSettings = settings;
|
||||
bool enqueueSucceeded = dispatcherQueue.TryEnqueue([=]() {
|
||||
if (!m_destroyed)
|
||||
{
|
||||
// Apply new settings to runtime composition objects.
|
||||
m_left_crosshairs.Brush().as<winrt::CompositionColorBrush>().Color(m_crosshairs_color);
|
||||
m_right_crosshairs.Brush().as<winrt::CompositionColorBrush>().Color(m_crosshairs_color);
|
||||
m_top_crosshairs.Brush().as<winrt::CompositionColorBrush>().Color(m_crosshairs_color);
|
||||
m_bottom_crosshairs.Brush().as<winrt::CompositionColorBrush>().Color(m_crosshairs_color);
|
||||
m_left_crosshairs_border.Brush().as<winrt::CompositionColorBrush>().Color(m_crosshairs_border_color);
|
||||
m_right_crosshairs_border.Brush().as<winrt::CompositionColorBrush>().Color(m_crosshairs_border_color);
|
||||
m_top_crosshairs_border.Brush().as<winrt::CompositionColorBrush>().Color(m_crosshairs_border_color);
|
||||
m_bottom_crosshairs_border.Brush().as<winrt::CompositionColorBrush>().Color(m_crosshairs_border_color);
|
||||
m_root.Opacity(m_crosshairs_opacity);
|
||||
UpdateCrosshairsPosition();
|
||||
}
|
||||
});
|
||||
if (!enqueueSucceeded)
|
||||
{
|
||||
Logger::error("Couldn't enqueue message to update the crosshairs settings.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void InclusiveCrosshairs::DestroyInclusiveCrosshairs()
|
||||
{
|
||||
StopDrawing();
|
||||
PostQuitMessage(0);
|
||||
}
|
||||
|
||||
LRESULT CALLBACK InclusiveCrosshairs::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) noexcept
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_NCCREATE:
|
||||
instance->m_hwnd = hWnd;
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
case WM_CREATE:
|
||||
return instance->CreateInclusiveCrosshairs() ? 0 : -1;
|
||||
case WM_NCHITTEST:
|
||||
return HTTRANSPARENT;
|
||||
case WM_SWITCH_ACTIVATION_MODE:
|
||||
if (instance->m_visible)
|
||||
{
|
||||
instance->StopDrawing();
|
||||
}
|
||||
else
|
||||
{
|
||||
instance->StartDrawing();
|
||||
}
|
||||
break;
|
||||
case WM_DESTROY:
|
||||
instance->DestroyInclusiveCrosshairs();
|
||||
break;
|
||||
default:
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool InclusiveCrosshairs::MyRegisterClass(HINSTANCE hInstance)
|
||||
{
|
||||
WNDCLASS wc{};
|
||||
|
||||
m_hinstance = hInstance;
|
||||
|
||||
SetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
|
||||
if (!GetClassInfoW(hInstance, m_className, &wc))
|
||||
{
|
||||
wc.lpfnWndProc = WndProc;
|
||||
wc.hInstance = hInstance;
|
||||
wc.hIcon = LoadIcon(hInstance, IDI_APPLICATION);
|
||||
wc.hCursor = LoadCursor(nullptr, IDC_ARROW);
|
||||
wc.hbrBackground = (HBRUSH)GetStockObject(NULL_BRUSH);
|
||||
wc.lpszClassName = m_className;
|
||||
|
||||
if (!RegisterClassW(&wc))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
m_hwndOwner = CreateWindow(L"static", nullptr, WS_POPUP, 0, 0, 0, 0, nullptr, nullptr, hInstance, nullptr);
|
||||
|
||||
DWORD exStyle = WS_EX_TRANSPARENT | WS_EX_LAYERED | WS_EX_NOREDIRECTIONBITMAP | WS_EX_TOOLWINDOW;
|
||||
return CreateWindowExW(exStyle, m_className, m_windowTitle, WS_POPUP, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, m_hwndOwner, nullptr, hInstance, nullptr) != nullptr;
|
||||
}
|
||||
|
||||
void InclusiveCrosshairs::Terminate()
|
||||
{
|
||||
auto dispatcherQueue = m_dispatcherQueueController.DispatcherQueue();
|
||||
bool enqueueSucceeded = dispatcherQueue.TryEnqueue([=]() {
|
||||
m_destroyed = true;
|
||||
DestroyWindow(m_hwndOwner);
|
||||
});
|
||||
if (!enqueueSucceeded)
|
||||
{
|
||||
Logger::error("Couldn't enqueue message to destroy the window.");
|
||||
}
|
||||
}
|
||||
|
||||
#pragma region InclusiveCrosshairs_API
|
||||
|
||||
void InclusiveCrosshairsApplySettings(InclusiveCrosshairsSettings& settings)
|
||||
{
|
||||
if (InclusiveCrosshairs::instance != nullptr)
|
||||
{
|
||||
Logger::info("Applying settings.");
|
||||
InclusiveCrosshairs::instance->ApplySettings(settings, true);
|
||||
}
|
||||
}
|
||||
|
||||
void InclusiveCrosshairsSwitch()
|
||||
{
|
||||
if (InclusiveCrosshairs::instance != nullptr)
|
||||
{
|
||||
Logger::info("Switching activation mode.");
|
||||
InclusiveCrosshairs::instance->SwitchActivationMode();
|
||||
}
|
||||
}
|
||||
|
||||
void InclusiveCrosshairsDisable()
|
||||
{
|
||||
if (InclusiveCrosshairs::instance != nullptr)
|
||||
{
|
||||
Logger::info("Terminating the crosshairs instance.");
|
||||
InclusiveCrosshairs::instance->Terminate();
|
||||
}
|
||||
}
|
||||
|
||||
bool InclusiveCrosshairsIsEnabled()
|
||||
{
|
||||
return (InclusiveCrosshairs::instance != nullptr);
|
||||
}
|
||||
|
||||
int InclusiveCrosshairsMain(HINSTANCE hInstance, InclusiveCrosshairsSettings& settings)
|
||||
{
|
||||
Logger::info("Starting a crosshairs instance.");
|
||||
if (InclusiveCrosshairs::instance != nullptr)
|
||||
{
|
||||
Logger::error("A crosshairs instance was still working when trying to start a new one.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Perform application initialization:
|
||||
InclusiveCrosshairs crosshairs;
|
||||
InclusiveCrosshairs::instance = &crosshairs;
|
||||
crosshairs.ApplySettings(settings, false);
|
||||
if (!crosshairs.MyRegisterClass(hInstance))
|
||||
{
|
||||
Logger::error("Couldn't initialize a crosshairs instance.");
|
||||
InclusiveCrosshairs::instance = nullptr;
|
||||
return FALSE;
|
||||
}
|
||||
Logger::info("Initialized the crosshairs instance.");
|
||||
|
||||
MSG msg;
|
||||
|
||||
// Main message loop:
|
||||
while (GetMessage(&msg, nullptr, 0, 0))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
|
||||
Logger::info("Crosshairs message loop ended.");
|
||||
InclusiveCrosshairs::instance = nullptr;
|
||||
|
||||
return (int)msg.wParam;
|
||||
}
|
||||
|
||||
#pragma endregion InclusiveCrosshairs_API
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user