Compare commits

...

236 Commits

Author SHA1 Message Date
martinchrzan
423cd20922 Merge pull request #4596 from microsoft/user/martinchrzan/nugetConfig
Clearing any nuget configuration that might be coming from parent dir…
2020-06-30 09:38:26 +02:00
Martin Chrzan
69d5ef36e2 Clearing any nuget configuration that might be coming from parent directories, fixes #4595 2020-06-30 08:50:53 +02:00
Arjun Balgovind
0dd17cc175 Cleanup null reference fix with correct code practice (#4587)
* Fixed null reference exception on context menu buttons

* Cleaned up fix with correct practices
2020-06-29 15:47:10 -07:00
Arjun Balgovind
16e56c4edb Fixed null reference exception on context menu buttons (#4586) 2020-06-29 13:47:35 -07:00
Yevhenii Holovachov
f46b876fd6 Removed hook creating from constructor (#4572) 2020-06-29 18:19:43 +03:00
Clint Rutkas
1181ab67ba fixing installer by removing file no longer used (#4545)
Co-authored-by: Clint Rutkas <crutkas@microsoft.com>
2020-06-27 11:10:50 -07:00
Niels Laute
014c26be25 Fix for visual glitch (#4537) 2020-06-27 09:39:02 -07:00
Divyansh Srivastava
99eb9429fd Add calculator images to MSI (#4530) 2020-06-26 23:01:15 -07:00
Divyansh Srivastava
d3b10d0d4d Theme aware plugin (#4499)
* Migrate theme manager to infrastructure and added it as input to public API instance

* Working event-delegate for PublicAPIInstance

* Theme aware UWP applications

* Theme aware program plugin

* Update query icon on theme change

* Theme aware calculator plugin

* Fix issue with query running before theme change

* Theme based changes in ImageLoader

* Removed ErrorIcon direct references and added references from ImageLoader

* Nit fixes

* Removed unnecessary TODO in UWP.cs

* Added preference to theme based icons

* Added IDisposable interfaces to unsubscribe events
2020-06-26 17:42:06 -07:00
Niels Laute
d9597d5ad5 [Run] Minor UX tweaks (#4526)
* Tweaked the shadows so it's conform to Windows standards. Fixed margins so UI elements are more aligned

* Fix
2020-06-26 16:12:26 -07:00
Arjun Balgovind
55272e5ea2 Fix settings issue where settings.json would get reset on runner startup (#4524)
* Added flag to avoid saving before modules is initialized

* Added comment
2020-06-26 14:46:47 -07:00
Alekhya
d17fc86fa4 [PT Run] Clear binary and json storage files on version upgrade (#4479)
* Clean termination of powertoys process.

* Fixed issue with run not responding to WM_CLOSE

* Fixed serialization error in pinyin and image cache

* Fixed merge conflict

* Fixed nit wrt to master

* Basic framework of clearing up of cache is working

* formatting

* removed the default argument of load

* fixed nit comment

* rewriting the PowerToys version

* Each storage file has an associated version file which helps decide whether or not to delete that file on loading

* removed unnecessary reference

* renamed file to StoragePowerToysVersionInfo

* adding log files

* Checking whether the version strings are null, if so, we would clear the cache

* Added filepath to log files to make it more informative

* fixed nit naming

* using lesser than to compare instead of portable version

Co-authored-by: Divyansh Srivastava <somm14divi@gmail.com>
2020-06-26 11:54:42 -07:00
Clint Rutkas
0b391584d4 Update README.md 2020-06-26 11:35:37 -07:00
Arjun Balgovind
e3e02aa30b Skip ErrorIcon and DefaultIcon while resizing the dictionary (#4520)
* Skip ErrorIcon and DefaultIcon while resizing the dictionary

* Removed autogenerated using statement
2020-06-26 11:30:04 -07:00
Arjun Balgovind
403f53a397 Fixed ghost text casing (#4498) 2020-06-26 10:29:34 -07:00
Alekhya
bfd79e1af2 reduced the description weight by half (#4519) 2020-06-26 10:20:54 -07:00
Alekhya
5745a984aa Partial Fix for Memory issue - Limiting the number of ImageSources cached (#4433)
* reducing storage of images

* Added task.run

* cleaned up code and added comments

* Renamed variable

* refactored code

* Removed task.run because it was leading to race conditions in the concurrent dictionary and it was taking only upto 10 ms for reordering the dictionary

* Added comments and fixed variable name
2020-06-26 10:20:35 -07:00
Enrico Giordani
d2f1f67a22 Update version to 0.19.0 (#4518) 2020-06-26 19:01:03 +02:00
Enrico Giordani
d98cb50d7a Update version to 0.19.0 (#4518) 2020-06-26 19:00:27 +02:00
Yevhenii Holovachov
cc4864976a Changed position of callback(false) call on disabling hook for shift (#4515) 2020-06-26 17:20:10 +03:00
Divyansh Srivastava
92fa8b7421 PowerToys Run cache issue (#4472)
* Clean termination of powertoys process.

* Fixed issue with run not responding to WM_CLOSE

* Fixed serialization error in pinyin and image cache

* Fixed merge conflict

* Fixed nit wrt to master

* Fixed undeterministic behaviour of Environment.Exit function

* Update timing for terminate process
2020-06-25 16:03:50 -07:00
Arjun Balgovind
aad2e8012b Add environment exit statement (#4496) 2020-06-25 14:21:09 -07:00
Enrico Giordani
b3eae80ece [CI, test] add prefix to common lib test dll (#4491) 2020-06-25 18:04:50 +02:00
Enrico Giordani
b58d5b6066 [CI, test] add common lib unit tests (#4489) 2020-06-25 16:20:43 +02:00
Arjun Balgovind
f1b6e6570c Fix remapping issues to Home/PgUp and other keys which are also present on NumPad (#4398)
* Added extended key flag to more keys

* Add test for extended key flag

* Move shlwapi.lib reference

* Added shcore ref

* Fixed pipeline incompatibility

* Fixed lib declaration in common

* Fixed formatting

* Remove unused statements

* removed another statement
2020-06-24 20:28:54 -07:00
Arjun Balgovind
8e758507b1 Enable code analysis on Keyboard Manager projects (#4455)
* Enable code analysis and fix GetTickCount warning

* Fix arithmetic casting warning
2020-06-24 14:55:02 -07:00
Arjun Balgovind
2601d8b702 Fix missing dlls in MSI for 0.19 (#4474)
* Add/remove missing dlls and add search.interop nuget package ref

* Fixed formatting
2020-06-24 14:48:16 -07:00
Yevhenii Holovachov
fa0545e4b3 Added info to ManagedCommon project (#4468) 2020-06-24 18:36:37 +03:00
Yevhenii Holovachov
690208fd4e Fixed info for powerrename, previewpane and shortcutguide (#4447) 2020-06-24 18:08:55 +03:00
Chakib Ljazouli
3272575f70 Dynamic dialog titles for Key/Shortcuts remapping (#4251)
* Fix typo in dialog title

* Pass Remap Keys/Shortcuts dialog titles as argument
2020-06-23 20:00:58 -07:00
ryanbodrug-microsoft
fad3142a47 Fix for warning: Error CA1806 BringProcessToForeground calls SendInput but does not use the HRESULT or error code that the method returns. This could lead to unexpected behavior in error conditions or low-resource situations. Use the result in a conditional statement, assign the result to a variable, or pass it as an argument to another method. PowerLauncher C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\MainWindow.xaml.cs 73 Active 2020-06-23 17:51:17 -07:00
ryanbodrug-microsoft
1f74dcff14 Changing 'Any CPU' to 'x64' for Managed Common project. 2020-06-23 17:51:17 -07:00
ryanbodrug-microsoft
62c7183922 Setting 'Treat warnings as errors' to 'All' 2020-06-23 17:51:17 -07:00
ryanbodrug-microsoft
ef73b0a07f Setting treat warnings as errors to true for release as well. 2020-06-23 17:51:17 -07:00
ryanbodrug-microsoft
ec7d42d1fd Supressing NU1701 warning on known working nuget packages. This will allow us to turn warnings as errors on. 2020-06-23 17:51:17 -07:00
ryanbodrug-microsoft
256a17f2c9 Fixing:
Error CS0436 The type 'ActionKeywords' in 'C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\ActionKeywords.xaml.cs' conflicts with the imported type 'ActionKeywords' in 'Wox, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\ActionKeywords.xaml.cs'. PowerLauncher C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\ActionKeywords.xaml 7 Active
2020-06-23 17:51:17 -07:00
ryanbodrug-microsoft
165ffed9e6 Fix CA 1060 by moving PInvokes to a common NativeMethodsClass
Severity Code Description Project File Line Suppression State
Warning CA1060 Move pinvokes to native methods class PowerLauncher C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\App.xaml.cs 24 Active
2020-06-23 17:51:17 -07:00
ryanbodrug-microsoft
b89d6d78ef Fix or the following warning. Removing unused ReportWindow from Launcher
Warning CA1812 ReportWindow is an internal class that is apparently never instantiated. If so, remove the code from the assembly. If this class is intended to contain only static members, make it static (Shared in Visual Basic). PowerLauncher C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\ReportWindow.xaml.cs 15 Active
2020-06-23 17:51:17 -07:00
ryanbodrug-microsoft
6890561723 Severity Code Description Project File Line Suppression State
Warning CA1307 The behavior of 'string.IndexOf(string)' could vary based on the current user's locale settings. Replace this call in 'PowerLauncher.MainWindow.ListView_FirstItem(string)' with a call to 'string.IndexOf(string, System.StringComparison)'. PowerLauncher C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\MainWindow.xaml.cs 269 Active
2020-06-23 17:51:17 -07:00
ryanbodrug-microsoft
849ce04def Fix for Warning CA1823:
Severity Code Description Project File Line Suppression State
Warning CA1823 Unused field '_progressBarStoryboard'. PowerLauncher C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\MainWindow.xaml.cs 27 Active
2020-06-23 17:51:17 -07:00
ryanbodrug-microsoft
a29baf19d0 Fix for:
Severity Code Description Project File Line Suppression State
Warning CA2007 Consider calling ConfigureAwait on the awaited task PowerLauncher C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\MainWindow.xaml.cs 305 Active
2020-06-23 17:51:17 -07:00
ryanbodrug-microsoft
10d6a1fa54 Severity Code Description Project File Line Suppression State
Warning CA1801 Parameter text of method DelayedCheck is never used. Remove the parameter or use it in the method body. PowerLauncher C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\MainWindow.xaml.cs 303 Active
2020-06-23 17:51:17 -07:00
ryanbodrug-microsoft
6ea181c286 Fix for:
Warning CA1820 Test for empty strings using 'string.Length' property or 'string.IsNullOrEmpty' method instead of an Equality check. PowerLauncher C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\MainWindow.xaml.cs 291 Active
2020-06-23 17:51:17 -07:00
ryanbodrug-microsoft
2d890603c6 Fix for Warning CA1822 Member 'Hyperlink' does not access instance data and can be marked as static PowerLauncher C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\ReportWindow.xaml.cs 45 Active 2020-06-23 17:51:17 -07:00
ryanbodrug-microsoft
d1ca30a28f Fix for Warning CA1822 Member 'GetHighContrastBaseType' does not access instance data and can be marked as static PowerLauncher C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\ThemeManager.cs 65 Active 2020-06-23 17:51:17 -07:00
ryanbodrug-microsoft
35fccf8af8 Fix for Warning CA1031: Removing catch, as it doesn't recover from the exception, but hides the exception from showing up in crash reports / telemetry.
Warning CA1031 Modify '.ctor' to catch a more specific allowed exception type, or rethrow the exception. PowerLauncher C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\SettingsWatcher.cs 33 Active
2020-06-23 17:51:17 -07:00
ryanbodrug-microsoft
f5baa56e05 Fix for CA1031.
Settings.json is locked by the settings application and throws a system IO Exception.   This should be syncronized with the settings application, but for now I'm just fixing the exception to be more specific and not hide unexpected exceptions.

System.IO.IOException: 'The process cannot access the file 'C:\Users\ryanbod\AppData\Local\Microsoft\PowerToys\PowerToys Run\settings.json' because it is being used by another process.'

Severity Code Description Project File Line Suppression State
Warning CA1031 Modify 'OverloadSettings' to catch a more specific allowed exception type, or rethrow the exception. PowerLauncher C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\SettingsWatcher.cs 76 Active
2020-06-23 17:51:17 -07:00
ryanbodrug-microsoft
d2c1be5c2d Warning CA2002 Do not lock on objects with weak identity PowerLauncher C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\SettingsWatcher.cs 43 Active 2020-06-23 17:51:17 -07:00
ryanbodrug-microsoft
fd6525a9de Fix for Warning CA1822 :
Severity Code Description Project File Line Suppression State
Warning CA1822 Member 'ConvertHotkey' does not access instance data and can be marked as static PowerLauncher C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\SettingsWatcher.cs 85 Active
2020-06-23 17:51:17 -07:00
ryanbodrug-microsoft
ba03a134da Fix for CA1822:
Severity Code Description Project File Line Suppression State
Warning CA1822 Member 'WaitForPowerToysRunner' does not access instance data and can be marked as static PowerLauncher C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\App.xaml.cs 130 Active
2020-06-23 17:51:17 -07:00
ryanbodrug-microsoft
9184c64ecb Fix for
Severity Code Description Project File Line Suppression State
Warning CA1401 P/Invoke method 'OpenProcess' should not be visible PowerLauncher C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\App.xaml.cs 125 Active
2020-06-23 17:51:17 -07:00
ryanbodrug-microsoft
653a9664e4 Removing warnings relative to passing in unlocalized string literals. Most of these pertain to debug messages and aren't user facing. We may want to revisit localizing these later. 2020-06-23 17:51:17 -07:00
ryanbodrug-microsoft
51d0cedb29 Fix for:
Warning CA1806 Main calls TryParse but does not explicitly check whether the conversion succeeded. Either use the return value in a conditional statement or verify that the call site expects that the out argument will be set to the default value when the conversion fails. PowerLauncher C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\App.xaml.cs 45 Active
2020-06-23 17:51:17 -07:00
ryanbodrug-microsoft
fa6d1bb23c Fix for:
Warning CA1062 In externally visible method 'void App.Main(string[] args)', validate parameter 'args' is non-null before using it. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument. PowerLauncher C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\App.xaml.cs
2020-06-23 17:51:17 -07:00
ryanbodrug-microsoft
0f3b154699 Fix for the following:
Warning CA1001 Type 'MainWindow' owns disposable field(s) '_firstDeleteTimer' but is not disposable PowerLauncher C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\MainWindow.xaml.cs

    Warning CA1816 Change App.Dispose() to call GC.SuppressFinalize(object). This will prevent derived types that introduce a finalizer from needing to re-implement 'IDisposable' to call it. PowerLauncher C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\App.xaml.cs
2020-06-23 17:51:17 -07:00
ryanbodrug-microsoft
d6e2b096ca Adding static analysis (Microsoft.CodeAnalysis.FxCopAnalyzers) to PowerLauncher Project 2020-06-23 17:51:17 -07:00
Arjun Balgovind
2104a1250e Added step to dispose the keyboard hook object (#4449) 2020-06-23 17:19:36 -07:00
Alekhya
ca99f60964 [PT Run] Find applications using the PATH env variable (#4418)
* Search for programs in the path env variable

* removing list of disabled programs

* Added env variable string to classify apps

* reverted the fullpath change

* removing full paths while calculating dups

* removed dups

* removed debugging code

* Renamed to run command

* Added condition to filter run commands unless there is an exact match

* renamed occurances to RUN COMMAND

* localized the subtitle - Run command

* Added tests

* add fullpath back to hash calculation

* renamed the function
2020-06-23 11:40:11 -07:00
Yevhenii Holovachov
147c08bd71 Added info to FancyZones, KeyboardManager and PowerLauncher projects (#4445) 2020-06-23 18:36:39 +03:00
Yevhenii Holovachov
ad440f70fa Added info to projects inside root, tests and common folders (#4413) 2020-06-23 16:53:16 +03:00
Yevhenii Holovachov
bb22155482 Added info to new settings projects (#4417) 2020-06-23 16:47:07 +03:00
Seraphima Zykova
5c1999b3d0 [Settings] 'Check for updates' button behavior changed (#4385) 2020-06-23 15:53:02 +03:00
Arjun Balgovind
87f0fcfd52 Added hack to show window if open (#4428) 2020-06-22 15:38:55 -07:00
Clint Rutkas
f6d53bc337 upgrade xaml based nuget packages (#4426)
* Settings packages updated

* removing WinUI references from wox base

* removing unneeded reference

Co-authored-by: Clint Rutkas <crutkas@microsoft.com>
2020-06-22 15:23:39 -07:00
Arjun Balgovind
720fad80c3 Fix Launcher focus for most cases (#4362)
* Add SendInput hack

* Cleaned up code

* Fixed formatting

* Moved Activate fn call

* Add more comments with link to issue
2020-06-22 14:47:33 -07:00
Divyansh Srivastava
196055e50e Index Desktop Applications (#4422)
* Added support to index desktop app

* Fixed dedup for url files

* Added internet shortcut scheme for epic games

* Added test for internet shortcut dedup

* Updated hostname for steam game
2020-06-22 12:34:57 -07:00
Andrey Nekrasov
73125574e6 MSI: fix include dirs causing MSI pre-build event fail to build (#4415) 2020-06-22 17:00:39 +03:00
Ivan Stošić
27a35a0388 Fixed an issue with the shift key (#4411) 2020-06-22 15:57:30 +02:00
Andrey Nekrasov
8c6085b933 Runner: move Launcher to its own folder and simplify dll loading (#4379) 2020-06-22 13:01:33 +03:00
Andrey Nekrasov
bef14f551e FancyZones: fix possible crash in GetWorkAreasByDesktopId (#4380) 2020-06-22 12:46:54 +03:00
Yevhenii Holovachov
e56c2eb6ca Fixed version property to pull from Version.props in C# projects (#4382) 2020-06-22 12:14:00 +03:00
Lavius Motileng
165365473f [Settings][Fix][Image Resizer ] Unused text box when selecting custom percent in new settings (#4344)
* save general settings to file upon launch

* ImageResizer: Added flags to disable and hide extra boxes

Co-authored-by: Lavius Motileng <laviusmotileng-ms>
2020-06-19 13:18:37 -07:00
Andrey Nekrasov
3bdd9a850f Runner: improve debugging experience with hooks (#4377)
* Runner: improve debugging experience with hooks
2020-06-19 14:13:38 +03:00
yuyoyuppe
b84ea020f2 fixup! forgot to rename 2020-06-19 13:27:29 +03:00
Seraphima Zykova
90efc5740f [WinAppDriver tests] Affection on user setting files fix (#4186) 2020-06-19 11:09:12 +03:00
Alekhya
c78e6588ad init description (#4391) 2020-06-18 17:15:21 -07:00
Divyansh Srivastava
a21a3827fd Remove hidden files from indexer results (#4325)
* Added functionality to not display hidden files

* Added interfaces for seperating db layer

* Updated variable naming and refactored Database connection class

* Added tests for WindowsSearchAPI class

* Fixed nit with braces

* Added function to test that all connections from database are closed
2020-06-18 15:42:28 -07:00
yuyoyuppe
2effbd0baf Runner: improve debugging experience with hooks 2020-06-18 14:27:20 +03:00
Andrey Nekrasov
7ed03c8b90 Runner: autoupdate should prefer .exe installer instead of .msi (#4216) 2020-06-18 13:43:09 +03:00
Niels Laute
59ce90e924 [PowerToys Run] Vertical scrollbar for results list (#4343)
* Enabling vertical scrollbar and colors

* Extending the list under the scrollbar

* Fix
2020-06-17 09:48:30 -07:00
Yevhenii Holovachov
da38e6a23d [FancyZones] Changed Shift key capture method (#4274)
* Used windows hook to capture shift key instead of getting state of key on window move
2020-06-17 16:06:16 +03:00
vldmr11080
698e5ec6ea [FancyZones] Move window into last known position on active work area (if possible) (#4218)
* Move window into last known position on active work area (if possible)

* Refactor code to avoid double checks

* Address PR comments

* Perform all HWND checks at one place

* Improve handling of active/primary work area in app zone history

* Address PR comments: naming, arguments checks

* Rename some functions to increase readability

* Implement special handling in 2+ monitor scenario

* Minor naming change

* Simplify

* Improve readability

* Remove blank line

* Don't move away from secondary monitor if there is no app zone history

* Update comment

* FancyZonesEditor should not be zoned

* Preserve width and height (if possible) when opening on active monitor

* Maintain w/h whenever possible

* Remove scaling, add window coordinates on active monitor top-left corner

* If there is no app zone history on secondary screen, fallback to default windows behavior.
2020-06-17 11:55:14 +02:00
ryanbodrug-microsoft
7f25e3ba97 Allowing launcher to be run as startup project with no command line args (#4267) 2020-06-16 10:53:27 -07:00
Clint Rutkas
1a3500cad3 moving the editor config out the the root folder (#4289)
Co-authored-by: Clint Rutkas <crutkas@microsoft.com>
2020-06-16 08:59:38 -07:00
stefansjfw
31c30a7602 Apply general settings on runner startup (#4302) 2020-06-16 10:55:15 +02:00
Mehmet Murat Akburak
014f3b9873 [PowerRename] capturing groups fix (#4181)
* Fix capturing group bug when Match All Occurrences is not checked

* Capture groups are now available when Match All Occurences option is not selected

* Bug fix when capture group is indicated with leading zeros. $01 should be considered as $1 etc

* Use flags in regex_replace() when Match All Occurences is not selected

Now the behaviour is consistent with how regex works when Match All Occurences is selected.
2020-06-16 11:04:14 +03:00
Arjun Balgovind
49cbcf01c6 Add workaround for IME Caps Lock issue (#4123)
* Add workaround for Japanese IME Caps Lock issue

* Changed tweak to reset modifier key rather than Caps Lock

* added tests

* Fixed test comment

* Moved environment initialization in KBM tests to TEST_METHOD_INITIALIZE
2020-06-15 16:48:00 -07:00
stefansjfw
f8cc129f04 [FancyZones] Move Trace::VirtualDesktopChange (#4320)
* Move Trace::VirtualDesktopChange to catch only the actual VD changes

* Update the check

* Add double check
2020-06-15 19:44:07 +02:00
Alekhya
236c1208e6 PWAs should not show up when searching for the main app (#4221)
* Search shows up steam games

* Formatting

* Filtering only those steam shortcuts which run an application

* Using equals instead of ==

* PWAs should not show up when searching for the main app

* Modified the subtitle to say progressive web application

* renamed to web application

* To search for web applications for all chromium based browsers

* Renamed it to WebApplication

* Added unit tests and refactored code

* made string global const

* Added localization tags

* Added a separate function for localization as the IPublic API was not available to all

* Removed unnecessary references and variables

* Update src/modules/launcher/Plugins/Microsoft.Plugin.Program/Languages/de.xaml

Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com>

* Added enum for application types

Co-authored-by: htcfreek <61519853+htcfreek@users.noreply.github.com>
2020-06-12 13:11:24 -07:00
Davide Giacometti
4c70e75bfc fix launcher network path (#4224) 2020-06-12 11:42:31 -07:00
pekspro
e8c5f3a882 Fixes null reference exception. (#3436) 2020-06-12 11:42:13 -07:00
Divyansh Srivastava
302df56ee1 Added support to run apps in development mode (#4217) 2020-06-11 18:24:45 -07:00
chrisgch
ccfc4d68f3 Setting WS_CHILD on preview handler (#3048) 2020-06-11 15:32:35 -07:00
Arjun Balgovind
071ea1dc97 KBM - Set up tests for keyboard hook remapping logic (#4004)
* Add test proj, refactor proj with filters, and move single remap function to a separate header

* Moved all methods to header files

* remove more unused commented code

* Reverted sln file

* Fixed sln file

* Added interface wrapping SendInput calls

* fixed formatting

* Created test mock class

* Added keyboard input logic

* Fixed compilation errors and added nuget reference to CppWinRT

* Added tests for single key remapping

* Refactored code for adding shortcut remap tests

* Separated test classes

* Fixed tests in release mode

* Added more tests

* Resolved comments
2020-06-11 13:07:46 -07:00
Tomas Agustin Raies
670033c4da [Settings/Run] LowLevel Keyboard hooking for Hotkeys (#3825)
* [Launcher/Settings] Low Level Keyboard Hooks

* [Run] LowLevel Keyboard Hook for Hotkeys

* Prevent shortcuts from auto repeating when keeping the keys pressed down
2020-06-11 12:59:36 -07:00
Arjun Balgovind
fa7e4cc817 Tweaked OS Detection project structure and added os check for PT Run (#4253)
* Tweaked OS Detection project structure and added check in Launcher

* Reverted formatter change to minimize diff
2020-06-11 11:47:15 -07:00
Clint Rutkas
67c8d80190 Safeguarding end user links in settings (#4226)
* first adjustment to wiki move

* Image Resizer and deleting imgs for FZ

* updating stuff to aka links

* updating app to leverage aka links

* moving files to wiki

* KBM adjustment

* updating

* getting PT Run moved over

* Shortcut guide and fixing launcher's readme text

* Update README.md

* img for shortcut guide moved to wiki

* updated setting img to be aka link as well
2020-06-11 10:16:39 -07:00
vldmr11080
792ce53992 Fix invalid namespace (#4259) 2020-06-11 17:03:02 +02:00
vldmr11080
b0a25f59d9 [Installer] Restart explorer.exe programatically after successful update (#4215)
* Restart explorer.exe programatically after successful update

* Move RestartManager related code into common

* Add newline at the end of files

* Note that explorer.exe should not be localized string
2020-06-11 10:09:06 +02:00
Niels Laute
d76234c112 [PT Run] Updated themes (dark/light/highcontrast) (#4119)
* Updated themes (dark/light/highcontrast)

* Updated semi-transparent colors to opague colors (for ClearType)

* Added theme brushes (light/dark/high contrast) for scrollbar.
2020-06-10 11:15:15 -07:00
Yevhenii Holovachov
6fdfd3b9e7 [PT Run] Closing PT Run and new settings app when PowerToys is not running (#3853)
Closing PowerLauncher, FZ Editor and new settings app when PowerToys is not running
2020-06-10 20:58:34 +03:00
dependabot[bot]
38350a1ae4 Bump websocket-extensions from 0.1.3 to 0.1.4 in /src/settings-web (#4108)
Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/faye/websocket-extensions-node/releases)
- [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md)
- [Commits](https://github.com/faye/websocket-extensions-node/compare/0.1.3...0.1.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-06-10 19:36:53 +02:00
Alekhya
ce2bba751c Fix for Steam games not showing up (#4124)
* Search shows up steam games

* Formatting

* Filtering only those steam shortcuts which run an application

* Using equals instead of ==

* Case change in Internet shortcut
2020-06-10 10:34:48 -07:00
Arjun Balgovind
f149736a20 Add additional shortcut validation logic in Remap Shortcuts UI (#4068)
* Add more validation logic for shortcut remaps UI

* Fixed a bug in CheckRepeatedModifier logic
2020-06-10 08:25:41 -07:00
Alekhya
40330be123 Added case insensitive hash code calculation (#4206) 2020-06-09 14:12:53 -07:00
Divyansh Srivastava
93af4fc6b0 Fixed initial focus on WPF issue (#4113)
* Fixed initial focus on WPF issue

* Added comment for property change

* Updated function naming for visibility callback
2020-06-09 09:16:20 -07:00
Josh Soref
b574d4e388 Spelling - remaining code changes (#3963)
* spelling: commit

* spelling: exclusion

* spelling: initial

* spelling: occurred

* spelling: programmatically

* spelling: should

* spelling: successfully

* spelling: committed

* spelling: directly
2020-06-09 10:11:02 +02:00
Ivan Stošić
eb4b429e19 [Action runner] Support running generic targets as non-elevated (#3863)
* Initial work, not tested

* Forgot the most important part

* Use target argument instead of hardcoded string

* Removed old way of running Launcher

* Completed rebase, updated some code
2020-06-08 22:53:40 +02:00
Josh Soref
21929b1db2 Spelling misc (#4199)
* spelling: accessibility

* spelling: occurrences
2020-06-08 22:43:59 +02:00
Clint Rutkas
a5197ee039 making alt-f4 ignored (#4023) 2020-06-08 13:18:42 -07:00
Clint Rutkas
e974981725 Update community.md 2020-06-05 15:46:52 -07:00
Niels Laute
9ae4dd3dfe Updated the PT Run icon to #4041 (#4114) 2020-06-05 15:45:18 -07:00
Alekhya
d0e4dabe90 Fix for UWP icons not showing up (#4008)
* Added fix for UWP icons not showing up

* updated comment and reversed the list of target sizes

* find the icon closest in size to the appIcon size

* Remove nlog reference that was added by mistake
2020-06-05 15:05:00 -07:00
Clint Rutkas
a3c569137e Getting system up and going instructions (#4013)
* Update readme.md

* Update readme.md

* Update readme.md

* adjusted based off Raf's comments

* Update readme.md
2020-06-05 14:21:06 -07:00
Arjun Balgovind
3edb360d79 Fix remapping from Num Lock (#4083)
* Added num lock remap workaround

* Added comments

* Changed to 2 suppressed key events

* Fixed typos
2020-06-05 12:54:52 -07:00
Arjun Balgovind
f5285b48b1 Fix remapping to Alt+Tab/Win+Space style shortcuts (#3965)
* Add skip to currently invoked shortcut code - should change no behavior

* Fixed Alt tab issue

* Added comment

* Added step to check if original shortcut action key should be pressed

* Fix number of cases in comment
2020-06-05 11:39:38 -07:00
Alekhya
c01b76e098 Fix for PWAs and command prompt not showing up as the first result (#4020)
* Added code which increments the score for the app without any arguments

* Removed magic number and added var
2020-06-05 11:34:16 -07:00
Divyansh Srivastava
6adb47c447 Theming for powertoys run (#4007)
* Removed Wox Theme Manager

* Added Light and dark theme and template for high contrast theme

* Updated themeManager to remove strings

* Fixed issue with high contrast theme not being applied

* Fixed formatting

* Updated MSI to include dll for Mahapps and controlzex

* Added support for multiple high contrast themes
2020-06-05 09:58:30 -07:00
vldmr11080
b0b2d3a727 [FancyZones] App zone history on multiple desktops (#3932)
* Remove app zone history belonging to deleted virtual desktop.

* Implement support fancy zones app zone history on multiple desktops.

* Break when device id is located to avoid unnecessary loop iterations.

* Fix failing unit tests after JSONHelpers API changes.

* Use valid UUIDs in json helper unit tests.

* User properly formated test data in app zone history unit tests.

* Don't delete entire app history when moving out of zone on one desktop.
2020-06-05 17:25:52 +02:00
Yevhenii Holovachov
8410d7b08e [FancyZones] Secondary mouse buttons click to toggle zones activation (#3989)
* Changed option name in settings, changed behaviour of zones activation by mouse to switch
* Removed IsDragEnabled from ZoneWindow
2020-06-05 17:53:08 +03:00
Enrico Giordani
e6408a0c37 [runner] Change way of dropping privileges to start PT Run 2020-06-05 10:35:11 +02:00
Seraphima Zykova
e96c82b171 Uniform style for button designations in settings (#4070) 2020-06-05 09:51:09 +03:00
Enrico Giordani
ee31813a0d Now working on 0.18.3 2020-06-05 07:27:45 +02:00
Lavius Motileng
ac62fd6204 added error handling for FZ Hotkeys (#4057)
* added error handling for FZ Hotkeys

* moved hint to hot key control text

* updated icon size 16px

* updated styling and fixed typos

* fixed typo

* moved text to string resource

Co-authored-by: Lavius Motileng <laviusmotileng-ms>
2020-06-04 14:52:04 -07:00
Clint Rutkas
25fbcc144c Update README.md
tweaking to 18.2
2020-06-04 11:18:41 -07:00
Lavius Motileng
30cb7e62fd removed restrictions for image-resizer file format (#3377) 2020-06-04 11:05:28 -07:00
smiley
7c7ccc3a07 [PowerToys Run] Add "ignore hotkeys in fullscreen" setting (#3262) (#3604)
Connect Wox's existing "ignore hotkeys in fullscreen mode" setting to PowerLauncher and the PowerToys settings UI.

This allows PowerLauncher to ignore hotkeys if any application is currently in fullscreen mode, whether it's real exclusive fullscreen or borderless windowed mode. This applies to things like fullscreen games, video and presentations but not maximized windows.
2020-06-04 10:21:16 -07:00
vldmr11080
fb3f4fa0a8 Connect appZoneHistory settings with rest of the stack in settings v2 (#4047) 2020-06-04 14:33:03 +02:00
stefansjfw
2b62244806 Cleanup Editor cmd args (#4022) 2020-06-04 13:01:42 +02:00
stefansjfw
f5dc197e8b [example_powertoy] Remove example_powertoy (#3955)
* Remove example_powertoy

* Address PR comments
2020-06-04 12:28:30 +02:00
Josh Soref
e6060048bd spelling: restart 2020-06-04 11:38:21 +02:00
Clint Rutkas
f83ff068ae Update README.md 2020-06-03 16:03:36 -07:00
Clint Rutkas
b21a6b76e0 Expanding 'community' section (#4028)
* updating for #3977

* spelling
2020-06-03 15:28:59 -07:00
Arjun Balgovind
70527022d9 Moved component to KBM directory (#4009) 2020-06-03 10:41:35 -07:00
Alekhya
8cddd595d4 Fix for File explorer not showing up and multiple notepads (#3969)
* reverted the dedup code, file explorer shows up but so do duplicates

* Fixed file explorer and dedup

* Formatting

* Added tests for all the cases

* Formatting

* Tests

* take name and exe into consideration while calculating hash

* unique primes while calculating hash code
2020-06-02 14:36:32 -07:00
Niels Laute
96b79d5f06 Fabric UI reference update (#3991)
Microsoft changed the name of Fabric UI to Fluent UI. Updated title and URL (which still links to the same page, just with a direct link instead of a redirect).
2020-06-02 12:04:58 -07:00
vldmr11080
1c7b07d614 Remove workarounds related to 0000 dekstop GUID. (#3931) 2020-06-02 12:06:36 +02:00
Niels Laute
0d59de5767 Fixed spacing issue 2020-06-02 11:26:58 +02:00
Niels Laute
e3613c54e9 'Autocomplete' is more common than 'autocompletion' 2020-06-02 11:26:58 +02:00
Niels Laute
5956e6d9c1 Updated strings for PowerRename 2020-06-02 11:26:58 +02:00
Niels Laute
ec895f271b Page header is now center aligned with first item, similiar to W10 Settings 2020-06-02 11:26:58 +02:00
Niels Laute
751f30e316 Changed numberbox to slider for FZ. Added opacity value textblock for all sliders 2020-06-02 11:26:58 +02:00
Niels Laute
cee8253cd3 Fixed width for controls so they are nicely aligned 2020-06-02 11:26:58 +02:00
stefansjfw
ae4cb6e372 Move FancyZones to separate build&install dir (#3961) 2020-06-02 10:48:07 +02:00
Arjun
398f976f3e Added KeyboardManager directory 2020-06-02 10:26:21 +02:00
Clint Rutkas
5f049beb04 Update pipeline.user.windows.yml 2020-06-01 16:10:34 -07:00
Alekhya
a8d67a1c60 Take space into consideration while calculating the first matched index (#3874) 2020-06-01 15:25:14 -07:00
Clint Rutkas
26aa9727a1 Update pipeline.user.windows.yml 2020-06-01 15:21:38 -07:00
Clint Rutkas
3cef696a65 Update pipeline.user.windows.yml 2020-06-01 13:54:12 -07:00
Divyansh Srivastava
397b1533f0 Somil55/merge wpf to master (#3840)
* Basic WPF searchbox working

* Updated key navigation and removed coldstart for searhbox

* refactored and added code back in commented

* Removed XAML Island references

* Basic searchbox+listview working

* Getting a bit more back

* got color there

* Result list bit better now

* Added image loader for WPF Image

* Partially got the context menus rendering again

* adjusting coldstart to load, control will load with main form

* getting context menus back

* mouse over works now

* Click now works, started to remove Win.XAML references

* being a bit more forcusful on focus

* Shadow text is not aligned

* fixing focus if listbox was used

* small tweak to fix shadow text

* inputs don't work but gotta figure out why.  commenting out

* preview text

* adding back in delay

* fixed height issue

* Applied the correct context button styles

* Created custom ItemContainerStyle to fix the blue highlights behind the command buttons

* Applied the correct highlight / mouseover styling

* Removed vertical scrollbar in listview

* fixed for alt-space prompt

* Fixed right click focus issue

* Somil55/wpf modifier keys (#3378)

* Removed DPI change as it was not required

* Global key hooks for context menu items

* Updated Key for shell, folder and indexer plugin

* Updated key mapping for indexer plugin

* Somil55/wpf context menu selection (#3389)

* Removed DPI change as it was not required

* Global key hooks for context menu items

* Updated Key for shell, folder and indexer plugin

* Updated key mapping for indexer plugin

* Add trigger to selection on tabbing

* Minor shadow adjustments so its more similiar to default shell shadow. Added intro/outro animations

* Added UWP-like scrollbar style for the results list

* Fixed formating and naming

* Removed Powerlauncher UI project

* Update PowerToys.sln

* Commented out scrollbar and fade in/out animations

* Added missing features from UWP branch

* Fixed formatting for Product.wxs

* Add dragging to WPF window

Co-authored-by: Clint Rutkas <clint@rutkas.com>
Co-authored-by: Niels Laute <niels.laute@live.nl>
2020-06-01 12:35:37 -07:00
Clint Rutkas
5680a34ec1 Update pipeline.user.windows.yml 2020-06-01 10:26:10 -07:00
stefansjfw
84a197299f [KeyboardManager&Installer] Move Keyboard Manager to separat build&install folder (#3949)
* Move Keyboard Manager to separat build&install folder

* Update pipeline
2020-06-01 18:29:40 +02:00
Clint Rutkas
4307882fa8 Update pipeline.user.windows.yml 2020-06-01 09:01:44 -07:00
Alekhya
d2dfbff832 Add resource only when it is not already present (#3842) 2020-06-01 08:17:28 -07:00
stefansjfw
8cc58d0b89 Move ImageResizer to separate folder (#3868) 2020-06-01 17:07:06 +02:00
Clint Rutkas
971fc462ab Update pipeline.user.windows.yml 2020-06-01 07:44:19 -07:00
Ivan Stošić
8d2256d359 Removed the stampZone argument (#3852) 2020-06-01 16:14:29 +02:00
Enrico Giordani
8f3b863edd [PowerRename] fix for documentation (#3952) 2020-06-01 14:05:52 +02:00
Clint Rutkas
4cc6c5ec35 Update pipeline.user.windows.yml 2020-05-31 22:19:50 -07:00
Clint Rutkas
cf53614721 Update pipeline.user.windows.yml 2020-05-31 21:05:02 -07:00
Clint Rutkas
efe84e58d7 Update pipeline.user.windows.yml 2020-05-31 15:45:35 -07:00
Clint Rutkas
cf59ad76fb Update pipeline.user.windows.yml 2020-05-31 10:16:51 -07:00
vldmr11080
2216cda2f1 [FancyZones] Improve monitor work area handling (#3418)
* Initial design for improving handling of different engaged work areas in fancyzones.

* Remove active device id check in ZoneWindow.

* Remove concept of active device identifier in JSONHelpers.

* Refactor interface description and add new method.

* Simplify ZoneWindow initialization.

* Default value for active ZoneWindow during move/size.

* Add newline at the end of file.

* Use COM pointers for ZoneWindow instead of passing raw ptr.

* Solve few issues after merging with master.

* Fix typo in documentation.
2020-05-31 12:36:45 +02:00
Clint Rutkas
595b15fcd9 Update pipeline.user.windows.yml 2020-05-29 20:57:17 -07:00
Clint Rutkas
a104c7f0f8 Update pipeline.user.windows.yml 2020-05-29 20:49:54 -07:00
Clint Rutkas
059392d257 Update pipeline.user.windows.yml 2020-05-29 20:46:47 -07:00
Clint Rutkas
5a1b3da394 Update pipeline.user.windows.yml 2020-05-29 20:42:43 -07:00
htcfreek
92d7c2926c [Settings] Change settings header to "Remap keys" on KBM pagr (#3654)
* Update settings header: Remap keys

We write "Remap Keyboard" but it must be "Remap keys" because we not remapping the whole keyboard. We only remap single keys.

* Tweaked c++ side naming

Co-authored-by: Arjun <arjunbalgovind@gmail.com>
2020-05-29 12:01:29 -07:00
Enrico Giordani
8f39697e3d [CDPx] publish symbols (#3864) 2020-05-29 17:28:57 +02:00
stefansjfw
ff328381af [FancyZones] Custom canvas layouts scaling (#3644)
* Make canvas layout scaling sensitive

* Revert "Make canvas layout scaling sensitive"

This reverts commit 705dab7e36.

* Revert "Revert "Make canvas layout scaling sensitive""

This reverts commit b9dd27644c.

* Cleanup

* Minor refactoring

* Address PR comments
2020-05-29 09:38:29 +02:00
Arjun Balgovind
3bb3c06456 KBM - Set treat warnings as errors, and clean up the dllmain.cpp file (#3203)
* Add test proj, refactor proj with filters, and move single remap function to a separate header

* Moved all methods to header files

* remove more unused commented code

* Undo test project addition

* Treat warnings as errors
2020-05-28 14:47:32 -07:00
vldmr11080
1cbcd41b17 [PowerRename] Move PowerRename module installation into separate folder (#3821)
* Move PowerRename module installation into separate folder.

* Update build pipeline.

* Correct order between modules.
2020-05-28 16:53:16 +02:00
stefansjfw
5ebd9eb577 [ShortcutGuide&Installer] Move Shortcut Guide to separate build and install folder (#3810)
* Move Shortcut Guide to separate build and install folder

* Rename shortcut_guide to ShortcutGuide

* Propagate change to the pipeline
2020-05-28 16:23:03 +02:00
Clint Rutkas
850d9ee095 Update README.md 2020-05-27 20:39:06 -07:00
Seraphima Zykova
5db1f91b01 [FancyZones] Unit-tests fix: keeping user settings unchanged (#3500) 2020-05-27 21:09:18 +03:00
Josh Soref
ac6b9712ad Spelling: ... shortcut guide (#3790)
* spelling: dimension

* spelling: hidden

* spelling: miniature

* spelling: parent

* spelling: popin

* spelling: signal

* spelling: suppress
2020-05-27 19:57:19 +02:00
stefansjfw
df93f4ba99 Use correct resource for Shourtcut Guide theme setting (#3788) 2020-05-27 19:45:21 +02:00
Clint Rutkas
7c20d46eeb Update README.md 2020-05-27 09:59:04 -07:00
Clint Rutkas
fe432fcca8 Update README.md 2020-05-27 09:53:41 -07:00
Clint Rutkas
5b1638ea59 Update README.md 2020-05-27 09:52:08 -07:00
htcfreek
87a1d4088b [Readme.md] Adding an uninstall hint (#3522)
* Adding Uninstall instaructions to ReadMe

* Fixed issue link

* Move "uninstall hint" link

* Did requested changes

Remove hand emoji, move link and fix text mistakes.
2020-05-27 09:48:54 -07:00
Josh Soref
038c346500 spelling: calculator (#3750) 2020-05-27 08:22:18 -07:00
Josh Soref
0bcaa13056 Spelling: ... runner settings (#3783)
* spelling: default

* spelling: elevated

* spelling: instance

* spelling: relative
2020-05-27 17:06:50 +02:00
Josh Soref
c0e62372e6 Spelling: ... core (#3782)
* spelling: administrator

* spelling: appearance

* spelling: expected

* spelling: explorer

* spelling: implementation

* spelling: integration

* spelling: successful

* spelling: windows
2020-05-27 08:06:17 -07:00
Josh Soref
84169cce10 Spelling: ... wox (#3775)
* spelling: arguments

* spelling: config

* spelling: deactivated

* spelling: exception

* spelling: folder

* spelling: initialize

* spelling: makesure

* spelling: response

* spelling: storage

* spelling: visibility

* spelling: serialized

* spelling: zipped
2020-05-27 08:05:54 -07:00
Josh Soref
c2c163ac4e Spelling: ... common (#3781)
* spelling: alignment

* spelling: awareness

* spelling: background

* spelling: bottom

* spelling: buttons

* spelling: comparison

* spelling: cortana

* spelling: exiting

* spelling: initialization

* spelling: middle

* spelling: properly

* spelling: succeeded

* spelling: unknown
2020-05-27 16:58:47 +02:00
Josh Soref
ecb5d2ae1c Spelling: ... fancyzones (#3777)
* spelling: defined

* spelling: excluded

* spelling: guid

* spelling: highlight

* spelling: original

* spelling: nonexistent
2020-05-27 16:55:46 +02:00
PrzemyslawTusinski
3d619f1670 [FancyZones] Outlook new message restore placement bug (#2534) 2020-05-27 16:52:59 +02:00
Josh Soref
3265549911 spelling: separator (#3751) 2020-05-26 18:10:58 -07:00
Sam Chivers
d5c3a3e5e8 Update README.md (#3753)
After reading the rest of the paragraph, I believe the intention was for this to read "This project welcomes contributions of all types" rather than "This project welcomes contributions of all times" or "..at all times"
2020-05-26 14:33:04 -07:00
Josh Soref
30dff09d7e spelling: toggle (#3749) 2020-05-26 20:12:20 +02:00
Clint Rutkas
85f7d19eb2 upgrade to cppwinrt after the last merge conflict (#3745) 2020-05-26 10:53:46 -07:00
vldmr11080
6adda5c29c [FancyZones] Remove "keep windows pinned to virtual desktop location" settings (#3687) 2020-05-26 17:06:12 +02:00
Josh Soref
4a03756b5b Spelling: ... (#3398) 2020-05-26 17:02:36 +02:00
Josh Soref
b1554ebf37 Spelling: ... src/modules (#3712) 2020-05-26 16:56:25 +02:00
Clint Rutkas
b6307b4fd6 Nuget updates (#3683)
* Sync'ing nuget packages. more to do

JSON, islands

* updating sql and oledb

* upgrading to 2.0 RTM for MahApps

* consolidated Microsoft.NETCore.UniversalWindowsPlatform

* updating Microsoft.Windows.ImplementationLibrary

* Microsoft.Windows.SDK.Contracts
2020-05-26 07:42:04 -07:00
Ivan Stošić
6f22c7ad19 [FancyZones] Added persistence to app zone history (#3132)
* Persist app zone history in a separate file

* Almost ready to be functionally tested

* Now all unit tests pass

* Bug fixes, it seems to work

* Various fixups

* Improved performance of FancyZones::UpdateWindowsPositions()
2020-05-26 16:01:12 +02:00
Andrey Nekrasov
bc9add783c sln: specify WinSDK version for cpp projects (#3728) 2020-05-26 17:00:09 +03:00
Niels Laute
ee67221068 [Settings] About section headers are now on a single line in collapsed mode (#3696)
* About section headers are now on a single line in collapsed mode

* Removed the more button, since the colorpickers are now in flyouts anyways
2020-05-26 09:34:14 +02:00
Josh Soref
71e528139c Spelling: ... src/modules/launcher (#3694) 2020-05-25 17:27:13 -07:00
Clint Rutkas
c674fe1f04 Migrate numberboxes to compact mode (#3375) 2020-05-25 08:58:29 -07:00
Niels Laute
d047e95bb5 [Settings] UX improvements to the FancyZones config page (#3658) 2020-05-25 11:47:32 +02:00
stefansjfw
791518d6c4 Don't migrate custom layout if type is invalid (#3645) 2020-05-25 10:59:05 +02:00
Niels Laute
83afd55e0e Updated titles (#3464) 2020-05-25 10:45:27 +02:00
vldmr11080
7870a66790 [FancyZones] Snap out of maximized window into zones with win + left/right arrow (#3097)
* Snap out of maximized window into zones with win + left/right arrow.

* Determine if there is anything to process before swallowing keypress.
2020-05-25 10:15:42 +02:00
Andrey Nekrasov
c923e96f3e sln: do not use PCH on CI (#3106) 2020-05-25 10:59:05 +03:00
Andrey Nekrasov
dd79834137 CI: remove unnecessary build commands (#3300) 2020-05-25 10:56:44 +03:00
Enrico Giordani
8995f0af55 Now working on 0.18.2 (#3542) 2020-05-22 20:28:49 +02:00
Clint Rutkas
e75a74565b Update README.md 2020-05-22 10:21:43 -07:00
vldmr11080
1792849b98 Expose InMoveSize from WindowMoveHandler. (#3525) 2020-05-22 16:42:29 +02:00
ricardosantos9521
c7fb1f6d17 bug fix #3209 (#3457)
Co-authored-by: ricar <ricar@ASUS>
2020-05-21 11:02:03 -07:00
Enrico Giordani
a856263081 [PowerToys Run] run non-elevated when runner is elevated (#3451)
* run Launcher non-elevated

* Implemented acquiring PID of Launcher

Co-authored-by: ivan100sic <ivan100sic@gmail.com>
2020-05-21 19:44:32 +02:00
Ivan Stošić
582d1320a3 [KBM] Fix compilation error 2020-05-21 11:06:50 +02:00
Josh Soref
3789da4305 Use check boxes (#3396) 2020-05-20 22:53:12 -07:00
sakariya
a36f97adfb Dev/saahmedm/fixlabel (#3366)
* Update EditShortcutsWindow.cpp

* Update EditKeyboardWindow.cpp

* Update README.md

* Update EditShortcutsWindow.cpp

* Update EditShortcutsWindow.cpp
2020-05-20 14:52:10 -07:00
Tim De Pauw
2cda53d3af Capitalize GitHub properly (#3356) 2020-05-20 14:28:25 -07:00
Bret
74007ea465 Merge pull request #3360 from microsoft/TheMrJukes-patch-1
Delete README.md
2020-05-20 14:10:37 -07:00
Bret
c88a7dba6b Delete README.md
This is no longer accurate and also talks about internal shares which we shouldn't do publically
2020-05-20 13:17:16 -07:00
Clint Rutkas
66b7863d43 Update README.md 2020-05-20 12:21:37 -07:00
Clint Rutkas
19b318a488 Update README.md (#3355) 2020-05-20 12:15:31 -07:00
ryanbodrug-microsoft
c606e3db43 Disabling IsRightTapEnabled on all UI Elements that steal focus from the text box. (#3349) 2020-05-20 11:38:14 -07:00
wolf99
f89ab74b29 Add 1903 requirement (#3321)
Have not seen this requirement mentioned anywhere until PowerToys is already installed.
For those installing PowerToys specifically to try this, it would be useful to know the requirement in advance, especially given that https://github.com/microsoft/PowerToys/blob/master/README.md mentions only 1803.
2020-05-20 11:20:11 -07:00
Clint Rutkas
4bbdec5044 Update README.md 2020-05-20 11:05:53 -07:00
Arjun Balgovind
56a727cf0d Added check for Type key/shortcut open but not in focus (#3235) 2020-05-20 09:56:00 -07:00
Arjun Balgovind
32f74e41ef Fix publish on local machines (#3270)
* Moved publishing to publish.cmd script

* Moved publish back to pre-build event
2020-05-20 09:55:17 -07:00
Ivan Stošić
e249bc5856 [FancyZones] Fix a regression with Chrome tabs jamming FZ (#3338) 2020-05-20 18:52:48 +02:00
Arjun Balgovind
32b8a344a6 Moved publishing to publish.cmd script (#3259) 2020-05-20 09:35:02 -07:00
Clint Rutkas
61c0c35e92 Fix for 3116, changing uwp to packaged (#3123) 2020-05-20 09:17:46 -07:00
Andrey Nekrasov
2eecaf4570 Revert "[FancyZones] Remove "keep windows pinned to virtual desktop location" settings (#3093)" (#3292)
This reverts commit 8f59247acb.
2020-05-20 11:57:17 +03:00
vldmr11080
8f59247acb [FancyZones] Remove "keep windows pinned to virtual desktop location" settings (#3093)
* Remove keep windows pinned to virtual desktop location FancyZones settings

* Remove virtual desktop switch handling for this scenario.
2020-05-20 10:49:28 +02:00
Clint Rutkas
eb3ec26279 fixing images so they deep link to module overview versus the img in readme (#3240)
* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md
2020-05-19 17:12:35 -07:00
Alekhya
f07d37ce0d [launcher] - Increase the score for Exact matches in the Name of the Application (#3213)
* Increase score for exact matches in the name

* Added tests for exact matching

* Used TestCase

* variable for bonus score

* Removed comment, variable is self explanatory
2020-05-19 16:10:40 -07:00
Alexander Sklar
2e8602eb43 Update win_hook_event_data.h (#3092) 2020-05-19 15:07:06 -07:00
Cloud Han
4277041b0e correct url (#3142) 2020-05-19 10:29:06 -07:00
Enrico Giordani
6801190180 Now working on 0.18.1 (#3141) 2020-05-19 18:20:35 +02:00
Clint Rutkas
067a9cf54d Dev/crutkas/change log0.18 (#3138)
* Update README.md

* Update README.md

* Update README.md

* Update README.md
2020-05-19 08:48:53 -07:00
621 changed files with 12852 additions and 9423 deletions

View File

@@ -6,11 +6,11 @@
<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [] Applies to #xxx
* [] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/PowerToys) and sign the CLA
* [] Tests added/passed
* [] Requires documentation to be updated
* [] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx
* [ ] Applies to #xxx
* [ ] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/PowerToys) and sign the CLA
* [ ] Tests added/passed
* [ ] Requires documentation to be updated
* [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx
<!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments

View File

@@ -1,4 +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 msbuild ../installer/PowerToysSetup.sln /p:Configuration=Release /p:Platform=x64 || exit /b 1
SET IsPipeline=1
call msbuild ../installer/PowerToysSetup.sln /p:Configuration=Release /p:Platform=x64 /p:CIBuild=true || exit /b 1

View File

@@ -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 msbuild ../PowerToys.sln /p:Configuration=Release /p:Platform=x64 || exit /b 1
call msbuild ../src/common/notifications/notifications_dll.vcxproj /p:Configuration=Release /p:Platform=x64 || exit /b 1
call msbuild ../src/common/notifications_winrt/notifications.vcxproj /p:Configuration=Release /p:Platform=x64 || exit /b 1
call msbuild ../PowerToys.sln /p:Configuration=Release /p:Platform=x64 /p:CIBuild=true || exit /b 1
SET PTRoot=..
call "..\installer\PowerToysSetup\publish.cmd"

View File

@@ -1,7 +1,7 @@
parameters:
configuration: 'Release'
platform: ''
additionalBuildArguments: ''
additionalBuildArguments: '/p:CIBuild=true'
jobs:
- job: Build${{ parameters.platform }}${{ parameters.configuration }}

View File

@@ -32,7 +32,6 @@ steps:
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArgs: ${{ parameters.additionalBuildArguments }}
clean: true
maximumCpuCount: true
- task: VSTest@2
@@ -45,5 +44,6 @@ steps:
**\UnitTests-SvgPreviewHandler.dll
**\UnitTests-PreviewHandlerCommon.dll
**\powerpreviewTest.dll
**\UnitTests-CommonLib.dll
!**\*TestAdapter.dll
!**\obj\**

View File

@@ -41,40 +41,45 @@ build:
name: 'Build Power Toys'
command: '.pipelines\build.cmd'
artifacts:
- to: 'Symbols'
include:
- 'x64/**/*.pdb'
exclude:
- 'x64/Release/obj/**/*.pdb'
- from: 'x64/Release'
to: 'Build_Output'
include:
- 'action_runner.exe'
- 'modules\ar\ImageResizer.resources.dll'
- 'modules\bg\ImageResizer.resources.dll'
- 'modules\ca\ImageResizer.resources.dll'
- 'modules\cs\ImageResizer.resources.dll'
- 'modules\de\ImageResizer.resources.dll'
- 'modules\es\ImageResizer.resources.dll'
- 'modules\eu-ES\ImageResizer.resources.dll'
- 'modules\fr\ImageResizer.resources.dll'
- 'modules\he\ImageResizer.resources.dll'
- 'modules\hu\ImageResizer.resources.dll'
- 'modules\it\ImageResizer.resources.dll'
- 'modules\nb-NO\ImageResizer.resources.dll'
- 'modules\nl\ImageResizer.resources.dll'
- 'modules\pl\ImageResizer.resources.dll'
- 'modules\pt-BR\ImageResizer.resources.dll'
- 'modules\ru\ImageResizer.resources.dll'
- 'modules\sk\ImageResizer.resources.dll'
- 'modules\tr\ImageResizer.resources.dll'
- 'modules\zh-Hans\ImageResizer.resources.dll'
- 'modules\ImageResizer\ar\ImageResizer.resources.dll'
- 'modules\ImageResizer\bg\ImageResizer.resources.dll'
- 'modules\ImageResizer\ca\ImageResizer.resources.dll'
- 'modules\ImageResizer\cs\ImageResizer.resources.dll'
- 'modules\ImageResizer\de\ImageResizer.resources.dll'
- 'modules\ImageResizer\es\ImageResizer.resources.dll'
- 'modules\ImageResizer\eu-ES\ImageResizer.resources.dll'
- 'modules\ImageResizer\fr\ImageResizer.resources.dll'
- 'modules\ImageResizer\he\ImageResizer.resources.dll'
- 'modules\ImageResizer\hu\ImageResizer.resources.dll'
- 'modules\ImageResizer\it\ImageResizer.resources.dll'
- 'modules\ImageResizer\nb-NO\ImageResizer.resources.dll'
- 'modules\ImageResizer\nl\ImageResizer.resources.dll'
- 'modules\ImageResizer\pl\ImageResizer.resources.dll'
- 'modules\ImageResizer\pt-BR\ImageResizer.resources.dll'
- 'modules\ImageResizer\ru\ImageResizer.resources.dll'
- 'modules\ImageResizer\sk\ImageResizer.resources.dll'
- 'modules\ImageResizer\tr\ImageResizer.resources.dll'
- 'modules\ImageResizer\zh-Hans\ImageResizer.resources.dll'
- 'modules\FancyZones\fancyzones.dll'
- 'modules\FancyZones\FancyZonesEditor.exe'
- 'modules\FileExplorerPreview\MarkdownPreviewHandler.dll'
- 'modules\FileExplorerPreview\powerpreview.dll'
- 'modules\FileExplorerPreview\PreviewHandlerCommon.dll'
- 'modules\FileExplorerPreview\SvgPreviewHandler.dll'
- 'modules\ImageResizer.exe'
- 'modules\ImageResizerExt.dll'
- 'modules\KeyboardManager.dll'
- 'modules\ImageResizer\ImageResizer.exe'
- 'modules\ImageResizer\ImageResizerExt.dll'
- 'modules\KeyboardManager\KeyboardManager.dll'
- 'modules\launcher\Microsoft.PowerToys.Settings.UI.Lib.dll'
- 'modules\launcher\Plugins\Microsoft.Plugin.Calculator\Microsoft.Plugin.Caculator.dll'
- 'modules\launcher\Plugins\Microsoft.Plugin.Calculator\Microsoft.Plugin.Calculator.dll'
- 'modules\launcher\Plugins\Microsoft.Plugin.Calculator\Wox.Infrastructure.dll'
- 'modules\launcher\Plugins\Microsoft.Plugin.Calculator\Wox.Plugin.dll'
- 'modules\launcher\Plugins\Microsoft.Plugin.Folder\Microsoft.Plugin.Folder.dll'
@@ -102,8 +107,8 @@ build:
- 'modules\launcher\Wox.Infrastructure.dll'
- 'modules\launcher\Wox.Plugin.dll'
- 'modules\Microsoft.Launcher.dll'
- 'modules\PowerRenameExt.dll'
- 'modules\shortcut_guide.dll'
- 'modules\PowerRename\PowerRenameExt.dll'
- 'modules\ShortcutGuide\ShortcutGuide.dll'
- 'Notifications.dll'
- 'os-detection.dll'
- 'PowerToys.exe'
@@ -127,34 +132,20 @@ build:
- 'PowerToysSetup-*.msi'
signing_options:
sign_inline: true # This does signing a soon as this command completes
# - !!buildcommand
# name: 'Archive symbols to Symbol Server'
# artifacts:
# - to: 'x64 Symbols'
# include:
# - 'x64/Release/action_runner.pdb'
# - 'x64/Release/Notifications.pdb'
# - 'x64/Release/PowerRenameUWPUI.pdb'
# - 'x64/Release/PowerToys.pdb'
# - 'x64/Release/PowerToysSettings.pdb'
# - 'x64/Release/modules/fancyzones.pdb'
# - 'x64/Release/modules/FancyZonesEditor.pdb'
# - 'x64/Release/modules/PowerRenameExt.pdb'
# - 'x64/Release/modules/shortcut_guide.pdb'
package:
commands:
- !!buildcommand
name: 'Build MSIX package'
command: 'installer\msix\build_msix_cdpx.cmd'
artifacts:
- from: 'installer\msix\bin'
to: 'Build_MSIX_Package_Output'
include:
- '*.msix'
- '*.msixbundle'
signing_options:
profile: '400'
#package:
# commands:
# - !!buildcommand
# name: 'Build MSIX package'
# command: 'installer\msix\build_msix_cdpx.cmd'
# artifacts:
# - from: 'installer\msix\bin'
# to: 'Build_MSIX_Package_Output'
# include:
# - '*.msix'
# - '*.msixbundle'
# signing_options:
# profile: '400'
static_analysis_options:
binskim_options:

View File

@@ -33,7 +33,8 @@ THE SOFTWARE.
### Wox License
**Source**: https://github.com/Wox-launcher/Wox
**Fork project source**: https://github.com/jjw24/Wox/
**Base project source**: https://github.com/Wox-launcher/Wox
The MIT License (MIT)

View File

@@ -34,12 +34,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "runner", "src\runner\runner
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "src\common\common.vcxproj", "{74485049-C722-400F-ABE5-86AC52D929B3}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shortcut_guide", "src\modules\shortcut_guide\shortcut_guide.vcxproj", "{A46629C4-1A6C-40FA-A8B6-10E5102BB0BA}"
ProjectSection(ProjectDependencies) = postProject
{74485049-C722-400F-ABE5-86AC52D929B3} = {74485049-C722-400F-ABE5-86AC52D929B3}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example_powertoy", "src\modules\example_powertoy\example_powertoy.vcxproj", "{44CC9375-3E6E-4D99-8913-7FB748807EBD}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ShortcutGuide", "src\modules\shortcut_guide\shortcut_guide.vcxproj", "{A46629C4-1A6C-40FA-A8B6-10E5102BB0BA}"
ProjectSection(ProjectDependencies) = postProject
{74485049-C722-400F-ABE5-86AC52D929B3} = {74485049-C722-400F-ABE5-86AC52D929B3}
EndProjectSection
@@ -204,8 +199,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.Launcher", "src\m
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerLauncher", "src\modules\launcher\PowerLauncher\PowerLauncher.csproj", "{F97E5003-F263-4D4A-A964-0F1F3C82DEF2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerLauncher.UI", "src\modules\launcher\PowerLauncher.UI\PowerLauncher.UI.csproj", "{4A3DE70C-684C-410D-B851-C23B6DAEDF16}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{E775CC2C-24CB-48D6-9C3A-BE4CCE0DB17A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "win-app-driver", "src\tests\win-app-driver\win-app-driver.csproj", "{880ED251-9E16-4713-9A70-D35FE0C01669}"
@@ -236,7 +229,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.PowerToys.Setting
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4981CCD1-4CD9-4A49-B240-00AA46493FF8}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
src\.editorconfig = src\.editorconfig
src\tests\win-app-driver\packages.config = src\tests\win-app-driver\packages.config
EndProjectSection
EndProject
@@ -258,6 +251,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Telemetry", "src\common\Man
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "os-detection", "src\common\os-detection\os-detection.vcxproj", "{E6410BFC-B341-498C-8C67-312C20CDD8D5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KeyboardManagerTest", "src\modules\keyboardmanager\test\KeyboardManagerTest.vcxproj", "{62173D9A-6724-4C00-A1C8-FB646480A9EC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ManagedCommon", "src\common\ManagedCommon\ManagedCommon.csproj", "{4AED67B6-55FD-486F-B917-E543DEE2CB3C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
@@ -276,10 +273,6 @@ Global
{A46629C4-1A6C-40FA-A8B6-10E5102BB0BA}.Debug|x64.Build.0 = Debug|x64
{A46629C4-1A6C-40FA-A8B6-10E5102BB0BA}.Release|x64.ActiveCfg = Release|x64
{A46629C4-1A6C-40FA-A8B6-10E5102BB0BA}.Release|x64.Build.0 = Release|x64
{44CC9375-3E6E-4D99-8913-7FB748807EBD}.Debug|x64.ActiveCfg = Debug|x64
{44CC9375-3E6E-4D99-8913-7FB748807EBD}.Debug|x64.Build.0 = Debug|x64
{44CC9375-3E6E-4D99-8913-7FB748807EBD}.Release|x64.ActiveCfg = Release|x64
{44CC9375-3E6E-4D99-8913-7FB748807EBD}.Release|x64.Build.0 = Release|x64
{07C389E3-6BC8-41CF-923E-307B1265FA2D}.Debug|x64.ActiveCfg = Debug|x64
{07C389E3-6BC8-41CF-923E-307B1265FA2D}.Debug|x64.Build.0 = Debug|x64
{07C389E3-6BC8-41CF-923E-307B1265FA2D}.Release|x64.ActiveCfg = Release|x64
@@ -420,10 +413,6 @@ Global
{F97E5003-F263-4D4A-A964-0F1F3C82DEF2}.Debug|x64.Build.0 = Debug|x64
{F97E5003-F263-4D4A-A964-0F1F3C82DEF2}.Release|x64.ActiveCfg = Release|x64
{F97E5003-F263-4D4A-A964-0F1F3C82DEF2}.Release|x64.Build.0 = Release|x64
{4A3DE70C-684C-410D-B851-C23B6DAEDF16}.Debug|x64.ActiveCfg = Debug|x64
{4A3DE70C-684C-410D-B851-C23B6DAEDF16}.Debug|x64.Build.0 = Debug|x64
{4A3DE70C-684C-410D-B851-C23B6DAEDF16}.Release|x64.ActiveCfg = Release|x64
{4A3DE70C-684C-410D-B851-C23B6DAEDF16}.Release|x64.Build.0 = Release|x64
{880ED251-9E16-4713-9A70-D35FE0C01669}.Debug|x64.ActiveCfg = Debug|x64
{880ED251-9E16-4713-9A70-D35FE0C01669}.Debug|x64.Build.0 = Debug|x64
{880ED251-9E16-4713-9A70-D35FE0C01669}.Release|x64.ActiveCfg = Release|x64
@@ -504,6 +493,14 @@ Global
{E6410BFC-B341-498C-8C67-312C20CDD8D5}.Debug|x64.Build.0 = Debug|x64
{E6410BFC-B341-498C-8C67-312C20CDD8D5}.Release|x64.ActiveCfg = Release|x64
{E6410BFC-B341-498C-8C67-312C20CDD8D5}.Release|x64.Build.0 = Release|x64
{62173D9A-6724-4C00-A1C8-FB646480A9EC}.Debug|x64.ActiveCfg = Debug|x64
{62173D9A-6724-4C00-A1C8-FB646480A9EC}.Debug|x64.Build.0 = Debug|x64
{62173D9A-6724-4C00-A1C8-FB646480A9EC}.Release|x64.ActiveCfg = Release|x64
{62173D9A-6724-4C00-A1C8-FB646480A9EC}.Release|x64.Build.0 = Release|x64
{4AED67B6-55FD-486F-B917-E543DEE2CB3C}.Debug|x64.ActiveCfg = Debug|x64
{4AED67B6-55FD-486F-B917-E543DEE2CB3C}.Debug|x64.Build.0 = Debug|x64
{4AED67B6-55FD-486F-B917-E543DEE2CB3C}.Release|x64.ActiveCfg = Release|x64
{4AED67B6-55FD-486F-B917-E543DEE2CB3C}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -511,7 +508,6 @@ Global
GlobalSection(NestedProjects) = preSolution
{74485049-C722-400F-ABE5-86AC52D929B3} = {1AFB6476-670D-4E80-A464-657E01DFF482}
{A46629C4-1A6C-40FA-A8B6-10E5102BB0BA} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC}
{44CC9375-3E6E-4D99-8913-7FB748807EBD} = {BEEAB7F2-FFF6-45AB-9CDB-B04CC0734B88}
{3BB8493E-D18E-4485-A320-CB40F90F55AE} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC}
{D1D6BC88-09AE-4FB4-AD24-5DED46A791DD} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC}
{F9C68EDF-AC74-4B77-9AF1-005D9C9F6A99} = {D1D6BC88-09AE-4FB4-AD24-5DED46A791DD}
@@ -552,7 +548,6 @@ Global
{F8B870EB-D5F5-45BA-9CF7-A5C459818820} = {4AFC9975-2456-4C70-94A4-84073C1CED93}
{E364F67B-BB12-4E91-B639-355866EBCD8B} = {C140A3EF-6DBF-4084-9D4C-4EB5A99FEE68}
{F97E5003-F263-4D4A-A964-0F1F3C82DEF2} = {C140A3EF-6DBF-4084-9D4C-4EB5A99FEE68}
{4A3DE70C-684C-410D-B851-C23B6DAEDF16} = {C140A3EF-6DBF-4084-9D4C-4EB5A99FEE68}
{880ED251-9E16-4713-9A70-D35FE0C01669} = {E775CC2C-24CB-48D6-9C3A-BE4CCE0DB17A}
{2F305555-C296-497E-AC20-5FA1B237996A} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC}
{AF2349B8-E5B6-4004-9502-687C1C7730B1} = {2F305555-C296-497E-AC20-5FA1B237996A}
@@ -574,6 +569,8 @@ Global
{08C8C05F-0362-41BC-818C-724572DF8B06} = {C140A3EF-6DBF-4084-9D4C-4EB5A99FEE68}
{5D00D290-4016-4CFE-9E41-1E7C724509BA} = {1AFB6476-670D-4E80-A464-657E01DFF482}
{E6410BFC-B341-498C-8C67-312C20CDD8D5} = {1AFB6476-670D-4E80-A464-657E01DFF482}
{62173D9A-6724-4C00-A1C8-FB646480A9EC} = {38BDB927-829B-4C65-9CD9-93FB05D66D65}
{4AED67B6-55FD-486F-B917-E543DEE2CB3C} = {1AFB6476-670D-4E80-A464-657E01DFF482}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C3A2F9D1-7930-4EF4-A6FC-7EE0A99821D0}

124
README.md
View File

@@ -4,7 +4,7 @@
Microsoft PowerToys is a set of utilities for power users to tune and streamline their Windows experience for greater productivity. Inspired by the [Windows 95 era PowerToys project](https://en.wikipedia.org/wiki/Microsoft_PowerToys), this reboot provides power users with ways to squeeze more efficiency out of the Windows 10 shell and customize it for individual workflows. A great overview of the Windows 95 PowerToys can be found [here](https://socket3.wordpress.com/2016/10/22/using-windows-95-powertoys/).
[What's Happening](#whats-happening) | [Downloading & Release notes][github-release-link] | [Contributing to PowerToys](#contributing)
[What's Happening](#whats-happening) | [Downloading & Release notes][github-release-link] | [Contributing to PowerToys](#contributing) | [Known issues](#known-issues)
## Build status
@@ -14,84 +14,82 @@ Microsoft PowerToys is a set of utilities for power users to tune and streamline
### FancyZones
<img align="left" src="./doc/images/overview/FancyZones_small.png" />[FancyZones](/src/modules/fancyzones/) is a window manager that makes it easy to create complex window layouts and quickly position windows into those layouts.
[<img align="left" src="./doc/images/overview/FancyZones_small.png" />](https://aka.ms/PowerToysOverview_FancyZones) [FancyZones](https://aka.ms/PowerToysOverview_FancyZones) is a window manager that makes it easy to create complex window layouts and quickly position windows into those layouts.
<br>
<br>
<br>
<br>
<br>
### Shortcut Guide
### File Explorer Add-ons (Preview Panes)
<img align="left" src="./doc/images/overview/Shortcut guide_small.png" />[Windows key shortcut guide](/src/modules/shortcut_guide) appears when a user holds the Windows key down for more than one second and shows the available shortcuts for the current state of the desktop.
[<img align="left" src="./doc/images/overview/PowerPreview_small.PNG" />](https://aka.ms/PowerToysOverview_FileExplorerAddOns) [File Explorer](https://aka.ms/PowerToysOverview_FileExplorerAddOns) add-ons right now are just limited to Preview Pane additions for File Explorer. Preview Pane is an existing feature in the File Explorer. To enable it, you just click the View tab in the ribbon and then click "Preview Pane".
PowerToys will now enable two types of files to be previewed: Markdown (.md) & SVG (.svg)
<br>
<br>
### Image Resizer
[<img align="left" src="./doc/images/overview/ImageResizer_small.png" />](https://aka.ms/PowerToysOverview_ImageResizer) [Image Resizer](https://aka.ms/PowerToysOverview_ImageResizer) is a Windows Shell Extension for quickly resizing images. With a simple right click from File Explorer, resize one or many images instantly. This code is based on [Brice Lambson's Image Resizer](https://github.com/bricelam/ImageResizer).
<br>
<br>
<br>
<br>
### Keyboard Manager
[<img align="left" src="./doc/images/overview/KBM_small.png" />](https://aka.ms/PowerToysOverview_KeyboardManager) [Keyboard Manager](https://aka.ms/PowerToysOverview_KeyboardManager) allows you to customize the keyboard to be more productive by remapping keys and creating your own keyboard shortcuts. This PowerToy requires Windows 10 1903 (build 18362) or later.
<br>
<br>
<br>
<br>
### PowerRename
<img align="left" src="./doc/images/overview/PowerRename_small.PNG" />[PowerRename](/src/modules/powerrename) is a Windows Shell Extension for advanced bulk renaming using search and replace or regular expressions. PowerRename allows simple search and replace or more advanced regular expression matching. While you type in the search and replace input fields, the preview area will show what the items will be renamed to. PowerRename then calls into the Windows Explorer file operations engine to perform the rename. This has the benefit of allowing the rename operation to be undone after PowerRename exits. This code is based on [Chris Davis's SmartRename](https://github.com/chrdavis/SmartRename).
<br>
[<img align="left" src="./doc/images/overview/PowerRename_small.PNG" />](https://aka.ms/PowerToysOverview_PowerRename) [PowerRename](https://aka.ms/PowerToysOverview_PowerRename) is a Windows Shell Extension for advanced bulk renaming using search and replace or regular expressions. PowerRename allows simple search and replace or more advanced regular expression matching. While you type in the search and replace input fields, the preview area will show what the items will be renamed to. PowerRename then calls into the Windows Explorer file operations engine to perform the rename. This has the benefit of allowing the rename operation to be undone after PowerRename exits. This code is based on [Chris Davis's SmartRename](https://github.com/chrdavis/SmartRename).
<br>
### File Explorer (Preview Panes)
<img align="left" src="./doc/images/overview/PowerPreview_small.PNG" />[File Explorer](/src/modules/previewpane) add-ons right now are just limited to Preview Pane additions for File Explorer. Preview Pane is an existing feature in the File Explorer. To enable it, you just click the View tab in the ribbon and then click "Preview Pane".
PowerToys will now enable two types of files to be previewed: Markdown (.md) & SVG (.svg)
<br>
<br>
<br>
### Image Resizer
<img align="left" src="./doc/images/overview/ImageResizer_small.png" />[Image Resizer](/src/modules/imageresizer) is a Windows Shell Extension for quickly resizing images. With a simple right click from File Explorer, resize one or many images instantly. This code is based on [Brice Lambson's Image Resizer](https://github.com/bricelam/ImageResizer).
<br>
<br>
<br>
<!---
### Keyboard Manager
<img align="left" src="./doc/images/overview/KBM_small.png" /> [Keyboard Manager](src/modules/keyboardmanager/) allows you to customize the keyboard to be more productive by remapping keys and creating your own keyboard shortcuts.
<br>
<br>
<br>
<br>
<br>
-->
<!---
### PowerToys Run
<img align="left" src="./doc/images/overview/PowerLauncher_small.png" /> [PowerToys Run](src/modules/launcher/) is a new toy in PowerToys that can help you search and launch your app instantly! It is open source and modular for additional plugins. Window Walker is now inside!
[<img align="left" src="./doc/images/overview/PowerLauncher_small.png" />](https://aka.ms/PowerToysOverview_PowerToysRun) [PowerToys Run](https://aka.ms/PowerToysOverview_PowerToysRun) is a new toy in PowerToys that can help you search and launch your app instantly with a simple alt-space and start typing! It is open source and modular for additional plugins. Window Walker is now inside too! This PowerToy requires Windows 10 1903 (build 18362) or later.
<br>
<br>
<br>
<br>
<br>
<br>
-->
### Version 1.0 plan
### Shortcut Guide
Our plan for all the [goals and utilities for v1.0 detailed over here in the wiki][v1].
[<img align="left" src="./doc/images/overview/Shortcut guide_small.png" />](https://aka.ms/PowerToysOverview_ShortcutGuide) [Windows key shortcut guide](https://aka.ms/PowerToysOverview_ShortcutGuide) appears when a user holds the Windows key down for more than one second and shows the available shortcuts for the current state of the desktop.
<br>
<br>
<br>
<br>
<br>
## Installing and running Microsoft PowerToys
👉 **Note:** Microsoft PowerToys requires Windows 10 1803 (build 17134) or later.
**Requirements**
- Windows 10 1803 (build 17134) or later.
- Have [.NET Core 3.1 Desktop Runtime](https://dotnet.microsoft.com/download/dotnet-core/thank-you/runtime-desktop-3.1.4-windows-x64-installer). The installer will prompt this but we want to directly make people aware.
### Via Github with MSI [Recommended]
Install from the [Microsoft PowerToys GitHub releases page][github-release-link]. Click on `Assets` to show the files available in the release and then click on `PowerToysSetup-0.17.0-x64.msi` to download the PowerToys installer.
Install from the [Microsoft PowerToys GitHub releases page][github-release-link]. Click on `Assets` to show the files available in the release and then click on `PowerToysSetup-0.18.2-x64.msi` to download the PowerToys installer.
**Note:** After installing, you will have to start PowerToys for the first time. We will improve install experience this moving forward but due to a possible install dependency, we can't start after install currently.
This is our preferred method.
### Via WinGet (Preview)
Download PowerToys from [WinGet](https://github.com/microsoft/winget-cli/releases). To install PowerToys, run the following command from the command line / PowerShell:
```powershell
WinGet install powertoys
```
### Other install methods
#### Via Chocolatey - ⚠ Unofficial
#### Via Chocolatey (Unofficial)
Download and upgrade PowerToys from [Chocolatey](https://chocolatey.org). If you have any issues when installing/upgrading the package please go to the [package page](https://chocolatey.org/packages/powertoys) and follow the [Chocolatey triage process](https://chocolatey.org/docs/package-triage-process)
@@ -107,6 +105,11 @@ To upgrade PowerToys, run the following command from the command line / PowerShe
choco upgrade powertoys
```
### Known issues
- [#2012 - Uninstalling with old control panel fails](https://github.com/microsoft/PowerToys/issues/2012): Please use the modern settings to uninstall. `Windows 10 Settings -> Apps -> Apps & features`
- [#3384 - PowerToys Settings window is empty](https://github.com/microsoft/PowerToys/issues/3384): Workaround appears to be run as admin. We are proactively looking into this as a hotfix.
### Processor support
We currently support the matrix below.
@@ -117,29 +120,30 @@ We currently support the matrix below.
## What's Happening
### April 2020 Update
### May 2020 Update
Our goals for 0.17 release cycle were updatability and stability.
Our goals for 0.18 release cycle was three big items, PowerToys Run, Keyboard manager, and migrating to the new settings system. This is also the first time we'll test out the auto-updating system.
**Auto-updating:** We just added in the code for doing updating, so the first chance to experience this will be when 0.18 is released. Were also seeing how aggressive everyone wants with this so right now, youll have to click “Install” for it to kick off the installer. This is something wed love feedback on.
Feedback is critical. We know there are areas for improvement on PT Run. We would love feedback so we can improve. We also would love to know if you want us to be more aggressive on auto-upgrading.
Another thing we did was utilized telemetry from PowerToys to prioritize virtual desktop FancyZone work. We knew there was a subset of bugs caused by an underlying issue and seeing how many users it affected helped us reprioritize to do the work sooner.
- We shipped [v0.17][github-release-link]!
- Auto-updating
- FancyZone improvement:
- Virtual desktop support should be much better!
- Better taskbar positioning
- Fixed non-admin install regression.
- We shipped [v0.18][github-release-link]!
- New Utilities
- PowerToys Run, our new application launcher (use alt-space to activate)
- Keyboard manager, a quick easy way to remap your keyboard
- Fixed [#243](https://github.com/microsoft/PowerToys/issues/243)'s setting issue
- Improved performance on FancyZones [#1264](https://github.com/microsoft/PowerToys/issues/1264)
- Lots of bug fixes!
For [0.18](https://github.com/microsoft/PowerToys/issues?q=is%3Aopen+is%3Aissue+project%3Amicrosoft%2FPowerToys%2F4), we are proactively working on:
For [0.19](https://github.com/microsoft/PowerToys/issues?q=is%3Aopen+is%3Aissue+project%3Amicrosoft%2FPowerToys%2F4), we are proactively working on:
- Win+R replacement (Launcher)
- Keyboard remapping
- Enable PT Run to be mapped to Win-Keys
- Stability / tech debt fixes
- Performance improvements with FancyZones
- A testing utility for FancyZones to be sure we can test different window configurations.
- Settings v2 / Fix bug #243
### Version 1.0 plan
Our plan for all the [goals and utilities for v1.0 detailed over here in the wiki][v1].
## Developer Guidance
@@ -147,7 +151,7 @@ Please read the [developer docs](/doc/devdocs) for a detailed breakdown.
## Contributing
This project welcomes contributions of all times. Help spec'ing, design, documentation, finding bugs are ways everyone can help on top of coding features / bug fixes. We are excited to work with the power user community to build a set of tools for helping you get the most out of Windows.
This project welcomes contributions of all types. Help spec'ing, design, documentation, finding bugs are ways everyone can help on top of coding features / bug fixes. We are excited to work with the power user community to build a set of tools for helping you get the most out of Windows.
We ask that **before you start work on a feature that you would like to contribute**, please read our [Contributor's Guide](contributing.md). We will be happy to work with you to figure out the best approach, provide guidance and mentorship throughout feature development, and help avoid any wasted or duplicate effort.

View File

@@ -2,6 +2,8 @@
The PowerToys team is extremely grateful to have the support of an amazing active community. The work you do is incredibly important. PowerToys wouldnt be near what it is without your help filing bugs, updating documentation, guiding the design, or writing features. We want to say thanks and to recognize your work. This is a living document dedicated to highlighting the high impact community members and their contributions.
Names are in alphabetical order based on first name.
## High impact community members
### [@Niels9001](https://github.com/niels9001/) - [Niels Laute](https://nielslaute.com/)
@@ -10,4 +12,36 @@ Niels has helped drive large sums of our update toward a new [consistent and mod
### [@riverar](https://github.com/riverar) - [Rafael Rivera](https://withinrafael.com/)
Rafael has helped do the [upgrade from CppWinRT 1.x to 2.0](https://github.com/microsoft/PowerToys/issues/1907). He directly provided feedback to the CppWinRT team for bugs from this migration as well.
Rafael has helped do the [upgrade from CppWinRT 1.x to 2.0](https://github.com/microsoft/PowerToys/issues/1907). He directly provided feedback to the CppWinRT team for bugs from this migration as well.
## Open source projects
As PowerToys creates new utilities, some will be based off existing technology. We'll continue to do our best to contribute back to these projects but their efforts were the base of some of our projects. We want to be sure their work is directly recognized.
### [@jjw24](https://github.com/jjw24/) - Jeremy Wu
Their fork of Wox was the base of PowerToys Run.
### [WoX Launcher](https://github.com/Wox-launcher/Wox/)
Initial base of jjw24's fork, which makes it the base of PowerToys Run.
## Microsoft community members
We would like to also directly call out some extremely helpful Microsoft employees that have directly contributed to PowerToys. This isn't their day job and was work they did out of passion. We want to say thank you and recognize your work.
### [@betsegaw](https://github.com/betsegaw/) - [Betsegaw Tadele](http://www.dreamsofameaningfullife.com/)
Window Walker, inside PowerToys Run, is from Beta.
### [@TheMrJukes](https://github.com/TheMrJukes/) - Bret Anderson
The base of FancyZones and a lot of performance adjustments are from the hard work of Bret.
### [@bricelam](https://github.com/bricelam/) - [Brice Lambson](https://bricelam.net/)
Image Resizer is from Brice.
### [@chrdavis](https://github.com/chrdavis/) - Chris Davis
PowerRename is from Chris's SmartRename.

View File

@@ -1,5 +0,0 @@
#### [`dllmain.cpp`](/src/modules/example_powertoy/dllmain.cpp)
Contains DLL boilerplate code and implementation of the [PowerToys interface](/src/modules/interface/).
#### [`trace.cpp`](/src/modules/example_powertoy/trace.cpp)
Contains code for telemetry.

View File

@@ -67,18 +67,6 @@ The returned PowerToy should be in the disabled state. The runner will call the
In case of errors returns `nullptr`.
Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.cpp):
```cpp
extern "C" __declspec(dllexport) PowertoyModuleIface* __cdecl powertoy_create() {
return new ExamplePowertoy();
}
ExamplePowertoy::ExamplePowertoy() {
init_settings();
}
```
## get_name
```cpp
@@ -87,13 +75,6 @@ virtual const wchar_t* get_name()
Returns the name of the PowerToy, it will be cached by the runner.
Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.cpp):
```cpp
virtual const wchar_t* get_name() override {
return L"Example Powertoy";
}
```
## get_events
```cpp
@@ -106,17 +87,6 @@ Returns a null-terminated table of the names of the events the PowerToy wants to
A nullptr can be returned to signal that the PowerToy does not want to subscribe to any event.
Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.cpp):
```cpp
virtual const wchar_t** get_events() override {
static const wchar_t* events[] = { ll_keyboard,
win_hook_event,
nullptr };
return events;
}
```
## get_config
```
@@ -129,44 +99,6 @@ If `buffer` is a null pointer or the buffer size is not large enough sets the re
Returns true if successful.
Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.cpp):
```cpp
virtual bool get_config(wchar_t* buffer, int* buffer_size) override {
HINSTANCE hinstance = reinterpret_cast<HINSTANCE>(&__ImageBase);
// Create a Settings object.
PowerToysSettings::Settings settings(hinstance, get_name());
settings.set_description(L"Serves as an example powertoy, with example settings.");
// Add an overview link to show in the Settings.
settings.set_overview_link(L"https://github.com/microsoft/PowerToys");
// Add a video link to show in the Settings.
settings.set_video_link(L"https://www.youtube.com/watch?v=d3LHo2yXKoY&t=21462");
// Add a bool property with a toggle editor.
settings.add_bool_toogle(
L"test_bool_toggle", // property name.
L"This is what a BoolToggle property looks like", // description or resource id of the localized string.
test_bool_prop // property value.
);
// More settings
...
// Add a custom action property. When using this settings type, the "call_custom_action()" method should be overriden as well.
settings.add_custom_action(
L"test_custom_action", // action name.
L"This is what a CustomAction property looks like", // label above the field.
L"Call a custom action", // button text.
L"Press the button to call a custom action in the Example PowerToy" // display values / extended info.
);
return settings.serialize_to_buffer(buffer, buffer_size);
}
```
## set_config
```cpp
@@ -175,31 +107,6 @@ virtual void set_config(const wchar_t* config)
After the user has changed the module settings in the Settings editor, the runner calls this method to pass to the module the updated values. It's a good place to save the settings as well.
Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.cpp):
```cpp
virtual void set_config(const wchar_t* config) override {
try {
// Parse the PowerToysValues object from the received json string.
PowerToysSettings::PowerToyValues _values =
PowerToysSettings::PowerToyValues::from_json_string(config);
// Update the bool property.
if (_values.is_bool_value(L"test bool_toggle")) {
test_bool_prop = _values.get_bool_value(L"test bool_toggle");
}
// More settings
...
save_settings();
}
catch (std::exception ex) {
// Improper JSON.
}
}
```
## call_custom_action
```cpp
@@ -209,31 +116,6 @@ Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.
Calls a custom action in response to the user pressing the custom action button in the Settings editor.
This can be used to spawn custom editors defined by the PowerToy.
Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.cpp):
```cpp
virtual void call_custom_action(const wchar_t* action) override {
try {
// Parse the action values, including name.
PowerToysSettings::CustomActionObject action_object =
PowerToysSettings::CustomActionObject::from_json_string(action);
if (action_object.get_name() == L"test_custom_action") {
// Custom action code to increase and show a counter.
++this->test_custom_action_num_calls;
std::wstring msg(L"I have been called ");
msg += std::to_wstring(this->test_custom_action_num_calls);
msg += L" time(s).";
MessageBox(NULL, msg.c_str(), L"Custom action call.", MB_OK | MB_TOPMOST);
}
}
catch (std::exception ex) {
// Improper JSON.
}
}
```
## enable
```cpp
@@ -242,14 +124,6 @@ Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.
Enables the PowerToy.
Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.cpp):
```cpp
virtual void enable() {
m_enabled = true;
}
```
## disable
```cpp
@@ -258,14 +132,6 @@ Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.
Disables the PowerToy, should free as much memory as possible.
Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.cpp):
```cpp
virtual void disable() {
m_enabled = false;
}
```
## is_enabled
```cpp
@@ -274,13 +140,6 @@ Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.
Returns the PowerToy state.
Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.cpp):
```cpp
virtual bool is_enabled() override {
return m_enabled;
}
```
## signal_event
```cpp
@@ -294,24 +153,6 @@ The data argument and return value meaning are event-specific:
Please note that some of the events are currently being signalled from a separate thread.
Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.cpp):
```cpp
virtual intptr_t signal_event(const wchar_t* name, intptr_t data) override {
if (wcscmp(name, ll_keyboard) == 0) {
auto& event = *(reinterpret_cast<LowlevelKeyboardEvent*>(data));
// Return 1 if the keypress is to be suppressed (not forwarded to Windows),
// otherwise return 0.
return 0;
} else if (wcscmp(name, win_hook_event) == 0) {
auto& event = *(reinterpret_cast<WinHookEvent*>(data));
// Return value is ignored
return 0;
}
return 0;
}
```
## register_system_menu_helper
```cpp
@@ -338,14 +179,6 @@ Item name is passed as an argument, so that module can distinguish between diffe
```
Destroy the PowerToy and free all memory.
Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.cpp):
```cpp
virtual void destroy() override {
delete this;
}
```
## Powertoys system menu helper interface
Interface for helper class responsible for handling all system menu related actions.
@@ -393,15 +226,15 @@ Process action taken on specific system menu item.
# Code organization
### [`powertoy_module_interface.h`](/src/modules/example_powertoy/powertoy_module_interface.h)
### [`powertoy_module_interface.h`](/src/modules/interface/powertoy_module_interface.h)
Contains the PowerToys interface definition.
### [`powertoy_system_menu.h`](/src/modules/example_powertoy/powertoy_system_module.h)
### [`powertoy_system_menu.h`](/src/modules/interface/powertoy_system_module.h)
Contains the PowerToys system menu helper interface definition.
### [`lowlevel_keyboard_event_data.h`](/src/modules/example_powertoy/lowlevel_keyboard_event_data.h)
### [`lowlevel_keyboard_event_data.h`](/src/modules/interface/lowlevel_keyboard_event_data.h)
Contains the `LowlevelKeyboardEvent` structure that's passed to `signal_event` for `ll_keyboard` events.
### [`win_hook_event_data.h`](/src/modules/example_powertoy/win_hook_event_data.h)
### [`win_hook_event_data.h`](/src/modules/interface/win_hook_event_data.h)
Contains the `WinHookEvent` structure that's passed to `signal_event` for `win_hook_event` events.

View File

@@ -6,7 +6,7 @@
- [Coding style](style.md).
- Try to package new ideas/components into libraries that have nicely defined interfaces.
- Package new ideas into classes or refactor existing ideas into a class as you extend.
- When adding new classes/methos/changing existing code: add new unit tests or update the existing tests.
- When adding new classes/methods/changing existing code: add new unit tests or update the existing tests.
## Github Workflow
@@ -46,32 +46,44 @@ Contains the source code of the PowerToys runner and of all of the PowerToys mod
Various tools used by PowerToys. Includes the Visual Studio 2019 project template for new PowerToys.
## Building code
## Compiling PowerToys
### Build Prerequisites
### Prerequisites for Compiling PowerToys
- Windows 10 1803 (build 10.0.17134.0) or above to build and run PowerToys.
- Visual Studio 2019 Community edition or higher, with the 'Desktop Development with C++' component and the Windows 10 SDK version 10.0.18362.0 or higher.
1. Windows 10 April 2018 Update (version 1803) or newer
2. Visual Studio Community/Professional/Enterprise 2019
3. Run the command below in cmd/terminal to install all the workloads and components for VS.<br />
**Note:** the script assumes VS is installed and Community edition. Please update path accordingly if Professional/Enterprise.
### Building the Code
```shell
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vs_installer.exe" ^
modify --installpath "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\community" ^
--add Microsoft.VisualStudio.Workload.NativeDesktop ^
--add Microsoft.VisualStudio.Workload.ManagedDesktop ^
--add Microsoft.VisualStudio.Workload.Universal ^
--add Microsoft.VisualStudio.Component.Windows10SDK.17134 ^
--add Microsoft.VisualStudio.ComponentGroup.UWP.VC ^
--add Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre ^
--add Microsoft.VisualStudio.Component.VC.ATL.Spectre
```
### Compiling Source Code
- Open `powertoys.sln` in Visual Studio, in the `Solutions Configuration` drop-down menu select `Release` or `Debug`, from the `Build` menu choose `Build Solution`.
- The PowerToys binaries will be in your repo under `x64\Release`.
- If you want to copy the `PowerToys.exe` binary to a different location, you'll also need to copy the `modules` and the `svgs` folders.
### Building the .msi Installer
## Building the Installer (.MSI)
* From the `installer` folder open `PowerToysSetup.sln` in Visual Studio, in the `Solutions Configuration` drop-down menu select `Release` or `Debug`, from the `Build` menu choose `Build Solution`.
* The resulting `PowerToysSetup.msi` installer will be available in the `installer\PowerToysSetup\x64\Release\` folder.
### Prerequisites Building the Installer (.MSI)
#### Prerequisites to Build the MSI Installer
1. Install the [WiX Toolset Visual Studio 2019 Extension](https://marketplace.visualstudio.com/items?itemName=RobMensching.WiXToolset).
2. Install the [WiX Toolset build tools](https://wixtoolset.org/releases/).
* Install the [WiX Toolset Visual Studio 2019 Extension](https://marketplace.visualstudio.com/items?itemName=RobMensching.WiXToolset).
* Install the [WiX Toolset build tools](https://wixtoolset.org/releases/).
### Compiling Installer (.MSI)
### Building the MSIX Installer
Please follow the [installer instructions](./installer/readme.md) which include items such as creating the self-signed cert for testing.
- From the `installer` folder open `PowerToysSetup.sln` in Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`, from the `Build` menu choose `Build Solution`.
- The resulting `PowerToysSetup.msi` installer will be available in the `installer\PowerToysSetup\x64\Release\` folder.
## Debugging
@@ -79,8 +91,8 @@ The following configuration issue only applies if the user is a member of the Ad
Some PowerToys modules require being run with the highest permission level if the current user is a member of the Administrators group. The highest permission level is required to be able to perform some actions when an elevated application (e.g. Task Manager) is in the foreground or is the target of an action. Without elevated privileges some PowerToys modules will still work but with some limitations:
- the `FancyZones` module will be not be able to move an elevated window to a zone.
- the `Shortcut Guide` module will not appear if the foreground window belongs to an elevated application.
- The `FancyZones` module will be not be able to move an elevated window to a zone.
- The `Shortcut Guide` module will not appear if the foreground window belongs to an elevated application.
To run and debug PowerToys from Visual Studio when the user is a member of the Administrators group, Visual Studio has to be started with elevated privileges. If you want to avoid running Visual Studio with elevated privileges and don't mind the limitations described above, you can do the following: open the `runner` project properties and navigate to the `Linker -> Manifest File` settings, edit the `UAC Execution Level` property and change it from `highestAvailable (level='highestAvailable')` to `asInvoker (/level='asInvoker')`, save the changes.
@@ -122,7 +134,7 @@ While developing, it's possible to connect the WebView to the development server
### [`Settings-web`](settings-web.md)
This project generates the web UI shown in the [PowerToys Settings](/src/editor).
It's a `ReactJS` project created using [UI Fabric](https://developer.microsoft.com/en-us/fabric#/).
It's a `ReactJS` project created using [Fluent UI](https://developer.microsoft.com/en-us/fluentui#/).
## Current modules
### [`FancyZones`](modules/fancyzones.md)
@@ -134,11 +146,6 @@ PowerRename is a Windows Shell Context Menu Extension for advanced bulk renaming
### [`Shortcut Guide`](modules/shortcut_guide.md)
The Windows Shortcut Guide, displayed when the WinKey is held for some time.
### _obsolete_ [`example_powertoy`](modules/example_powertoy.md)
An example PowerToy, that demonstrates how to create new ones. Please note, that this is going to become a Visual Studio project template soon.
This PowerToy serves as a sample to show how to implement the [PowerToys interface](/src/modules/interface/) when creating a PowerToy. It also showcases the currently implemented settings.
#### Options
This module has a setting to serve as an example for each of the currently implemented settings property:

View File

@@ -8,7 +8,7 @@ If you're running any application as an administrator (aka elevated) and PowerTo
We understand users will run applications elevated. We do as well. We have two options for you when this scenario happens:
1. **Recommended:** PowerToys will prompt when we detect a process that is elevated. Go to PowerToys settings inside the General Tab and click "Relaunch as adminstrator".
1. **Recommended:** PowerToys will prompt when we detect a process that is elevated. Go to PowerToys settings inside the General Tab and click "Relaunch as administrator".
2. Enable "Always run as administrator" in the PowerToys settings.
## What is "Run as Administrator" / Elevated processes

View File

@@ -1,5 +1,5 @@
#### [`main.cpp`](/src/runner/main.cpp)
Contains the executable starting point, initialization code and the list of known PowerToys. All singletones are also initialized here at the start. Loads all the powertoys by scanning the `./modules` folder and `enable()`s those makred as enabled in `%LOCALAPPDATA%\Microsoft\PowerToys\settings.json` config. Then it runs [a message loop](https://docs.microsoft.com/en-us/windows/win32/winmsg/using-messages-and-message-queues) for the tray UI. Note that this message loop also [handles lowlevel_keyboard_hook events](https://github.com/microsoft/PowerToys/blob/1760af50c8803588cb575167baae0439af38a9c1/src/runner/lowlevel_keyboard_event.cpp#L24).
Contains the executable starting point, initialization code and the list of known PowerToys. All singletones are also initialized here at the start. Loads all the powertoys by scanning the `./modules` folder and `enable()`s those marked as enabled in `%LOCALAPPDATA%\Microsoft\PowerToys\settings.json` config. Then it runs [a message loop](https://docs.microsoft.com/en-us/windows/win32/winmsg/using-messages-and-message-queues) for the tray UI. Note that this message loop also [handles lowlevel_keyboard_hook events](https://github.com/microsoft/PowerToys/blob/1760af50c8803588cb575167baae0439af38a9c1/src/runner/lowlevel_keyboard_event.cpp#L24).
#### [`general_settings.cpp`](./general_settings.cpp)
#### [`powertoy_module.h`](/src/runner/powertoy_module.h) and [`powertoy_module.cpp`](/src/runner/powertoy_module.cpp)

View File

@@ -80,7 +80,7 @@ Example module JSON (taken from Shortcut Guide):
```
produces this settings screen:
![Shortcut Guide settings](../images/settings/shorcut_guide_settings.png)
![Shortcut Guide settings](../images/settings/shortcut_guide_settings.png)
### Helper methods
@@ -191,7 +191,7 @@ settings.set_icon_key(L"pt-example");
settings.add_string(L"string_val", L"Example string label", L"example value");
settings.add_int_spinner(L"int_val", L"Example int label", 0, 0, 100, 10);
```
You can then use `std::wstring serialize()` or `bool serialize_to_buffer(wchar_t* buffer, int* uffer_size)` methods to generate output JSON string.
You can then use `std::wstring serialize()` or `bool serialize_to_buffer(wchar_t* buffer, int* buffer_size)` methods to generate output JSON string.
### Saving settings
Use
@@ -204,7 +204,7 @@ declared in [`settings_helpers.h`](/src/common/settings_helpers.h).
### Bool toggle
```c++
add_bool_toogle(name, description, value)
add_bool_toggle(name, description, value)
```
A simple on-off toggle. Parameters:
* `name` - Key for the element in the JSON.
@@ -213,7 +213,7 @@ A simple on-off toggle. Parameters:
This C++:
```c++
settings.add_bool_toogle(L"bool_name", L"description", true);
settings.add_bool_toggle(L"bool_name", L"description", true);
```
produces this settings element:

View File

@@ -86,7 +86,7 @@ For a detailed reference of how the settings are implemented in the runner and i
</td></tr></table>
```c++
settings.add_bool_toogle(name, description, value)
settings.add_bool_toggle(name, description, value)
```
A simple on-off toggle. Parameters:
* `name` - Key for the element in the JSON.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 762 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 405 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 588 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 641 KiB

View File

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

View File

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

View File

@@ -69,75 +69,11 @@
</PropertyGroup>
<Error Condition="!Exists('..\packages\WiX.3.11.2\build\wix.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\WiX.3.11.2\build\wix.props'))" />
</Target>
<PropertyGroup>
<PreBuildEvent>setlocal enableDelayedExpansion
rem Publish Settings
SET settingsProfileFolderName=..\..\..\..\src\core\Microsoft.PowerToys.Settings.UI.Runner\Properties\PublishProfiles\
rem Create the publish profile folder if it doesn%27t exist
IF NOT EXIST !settingsProfileFolderName! (mkdir !settingsProfileFolderName!)
SET settingsProfileFileName=SettingsProfile.pubxml
SET settingsPublishProfile=!settingsProfileFolderName!!settingsProfileFileName!
rem Create the publish profile pubxml
echo ^&lt;%3fxml version="1.0" encoding="utf-8"%3f^&gt; &gt; !settingsPublishProfile!
echo ^&lt;^^!-- &gt;&gt; !settingsPublishProfile!
echo https://go.microsoft.com/fwlink/%3fLinkID=208121. &gt;&gt; !settingsPublishProfile!
echo --^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;PropertyGroup^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;PublishProtocol^&gt;FileSystem^&lt;/PublishProtocol^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;Configuration^&gt;$(ConfigurationName)^&lt;/Configuration^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;Platform^&gt;$(PlatformName)^&lt;/Platform^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;TargetFramework^&gt;netcoreapp3.1^&lt;/TargetFramework^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;PublishDir^&gt;..\..\..\$(PlatformName)\$(ConfigurationName)\SettingsUIRunner^&lt;/PublishDir^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;RuntimeIdentifier^&gt;win-x64^&lt;/RuntimeIdentifier^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;SelfContained^&gt;false^&lt;/SelfContained^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;PublishSingleFile^&gt;False^&lt;/PublishSingleFile^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;PublishReadyToRun^&gt;False^&lt;/PublishReadyToRun^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;/PropertyGroup^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;/Project^&gt; &gt;&gt; !settingsPublishProfile!
rem In case of Release we should not use Debug CRT in VCRT forwarders
IF $(ConfigurationName)==Release (
"$(MSBuildBinPath)\msbuild.exe" ..\..\..\..\src\core\Microsoft.PowerToys.Settings.UI.Runner\Microsoft.PowerToys.Settings.UI.Runner.csproj -t:Publish -p:Configuration="$(ConfigurationName)" -p:Platform="$(PlatformName)" -p:AppxBundle=Never -p:VCRTForwarders-IncludeDebugCRT=false -p:PublishProfile=!settingsProfileFileName!
) ELSE (
"$(MSBuildBinPath)\msbuild.exe" ..\..\..\..\src\core\Microsoft.PowerToys.Settings.UI.Runner\Microsoft.PowerToys.Settings.UI.Runner.csproj -t:Publish -p:Configuration="$(ConfigurationName)" -p:Platform="$(PlatformName)" -p:AppxBundle=Never -p:PublishProfile=!settingsProfileFileName!
)
rem Publish Launcher
SET launcherProfileFolderName=..\..\..\..\src\modules\launcher\PowerLauncher\Properties\PublishProfiles\
rem Create the publish profile folder if it doesn%27t exist
IF NOT EXIST !launcherProfileFolderName! (mkdir !launcherProfileFolderName!)
SET launcherProfileFileName=LauncherProfile.pubxml
SET launcherPublishProfile=!launcherProfileFolderName!!launcherProfileFileName!
rem Create the publish profile pubxml
echo ^&lt;%3fxml version="1.0" encoding="utf-8"%3f^&gt; &gt; !launcherPublishProfile!
echo ^&lt;^^!-- &gt;&gt; !launcherPublishProfile!
echo https://go.microsoft.com/fwlink/%3fLinkID=208121. &gt;&gt; !launcherPublishProfile!
echo --^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;PropertyGroup^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;PublishProtocol^&gt;FileSystem^&lt;/PublishProtocol^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;Configuration^&gt;$(ConfigurationName)^&lt;/Configuration^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;Platform^&gt;$(PlatformName)^&lt;/Platform^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;TargetFramework^&gt;netcoreapp3.1^&lt;/TargetFramework^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;PublishDir^&gt;..\..\..\..\$(PlatformName)\$(ConfigurationName)\modules\launcher^&lt;/PublishDir^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;RuntimeIdentifier^&gt;win-x64^&lt;/RuntimeIdentifier^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;SelfContained^&gt;false^&lt;/SelfContained^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;PublishSingleFile^&gt;False^&lt;/PublishSingleFile^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;PublishReadyToRun^&gt;False^&lt;/PublishReadyToRun^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;/PropertyGroup^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;/Project^&gt; &gt;&gt; !launcherPublishProfile!
rem In case of Release we should not use Debug CRT in VCRT forwarders
IF $(ConfigurationName)==Release (
"$(MSBuildBinPath)\msbuild.exe" ..\..\..\..\src\modules\launcher\PowerLauncher\PowerLauncher.csproj -t:Publish -p:Configuration="$(ConfigurationName)" -p:Platform="$(PlatformName)" -p:AppxBundle=Never -p:VCRTForwarders-IncludeDebugCRT=false -p:PublishProfile=!launcherProfileFileName!
) ELSE (
"$(MSBuildBinPath)\msbuild.exe" ..\..\..\..\src\modules\launcher\PowerLauncher\PowerLauncher.csproj -t:Publish -p:Configuration="$(ConfigurationName)" -p:Platform="$(PlatformName)" -p:AppxBundle=Never -p:PublishProfile=!launcherProfileFileName!
<PreBuildEvent>IF NOT DEFINED IsPipeline (
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 -winsdk=10.0.18362.0
SET PTRoot=..\..\..\..
call "..\..\publish.cmd"
)</PreBuildEvent>
</PropertyGroup>
<!--

View File

@@ -3,6 +3,12 @@
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension" >
<?define FancyZonesProjectName="FancyZones"?>
<?define ImageResizerProjectName="ImageResizer"?>
<?define KeyboardManagerProjectName="KeyboardManager"?>
<?define PowerRenameProjectName="PowerRename"?>
<?define ShortcutGuideProjectName="ShortcutGuide"?>
<?define RepoDir="$(var.ProjectDir)..\..\" ?>
<?define BinX64Dir="$(var.RepoDir)x64\$(var.Configuration)\" ?>
<Product Id="*"
@@ -198,10 +204,6 @@
<!-- Close 'PowerToys.exe' before uninstall-->
<Property Id="MSIRESTARTMANAGERCONTROL" Value="Disable" />
<!-- Restart explorer.exe if we detect existing PowerRenameExt.dll or ImageResizerExt.dll installation -->
<util:CloseApplication Target="explorer.exe" RebootPrompt="no" TerminateProcess="0">
EXISTINGPOWERRENAMEEXTPATH OR EXISTINGIMAGERESIZERPATH
</util:CloseApplication>
<util:CloseApplication CloseMessage="yes" Target="PowerToys.exe" ElevatedCloseMessage="yes" RebootPrompt="no" TerminateProcess="0" />
</Product>
@@ -215,32 +217,33 @@
<Directory Id="INSTALLFOLDER" Name="PowerToys">
<Directory Id="SvgsInstallFolder" Name="svgs"/>
<Directory Id="ModulesInstallFolder" Name="modules">
<!-- Resource file directories -->
<?foreach Language in ar;bg;ca;cs;de;es;eu-ES;fr;he;hu;it;nb-NO;nl;pl;pt-BR;ru;sk;tr;zh-Hans?>
<Directory Id="ImageResizerInstallFolder" Name="$(var.ImageResizerProjectName)">
<!-- Resource file directories -->
<?foreach Language in ar;bg;ca;cs;de;es;eu-ES;fr;he;hu;it;nb-NO;nl;pl;pt-BR;ru;sk;tr;zh-Hans?>
<!--NB: Ids can't contain hyphens-->
<?if $(var.Language) = eu-ES?>
<?define IdSafeLanguage = eu_ES?>
<?define IdSafeLanguage = eu_ES?>
<?elseif $(var.Language) = nb-NO?>
<?define IdSafeLanguage = nb_NO?>
<?define IdSafeLanguage = nb_NO?>
<?elseif $(var.Language) = pt-BR?>
<?define IdSafeLanguage = pt_BR?>
<?define IdSafeLanguage = pt_BR?>
<?elseif $(var.Language) = zh-Hans?>
<?define IdSafeLanguage = zh_Hans?>
<?define IdSafeLanguage = zh_Hans?>
<?else?>
<?define IdSafeLanguage = $(var.Language)?>
<?define IdSafeLanguage = $(var.Language)?>
<?endif?>
<Directory Id="Resources$(var.IdSafeLanguage)Folder" Name="$(var.Language)" />
<?undef IdSafeLanguage?>
<?endforeach?>
<?endforeach?>
</Directory>
<Directory Id="PowerRenameInstallFolder" Name="$(var.PowerRenameProjectName)"/>
<Directory Id="ShortcutGuideInstallFolder" Name="$(var.ShortcutGuideProjectName)"/>
<Directory Id="FileExplorerPreviewInstallFolder" Name="FileExplorerPreview" />
<Directory Id="FancyZonesInstallFolder" Name="FancyZones" />
<Directory Id="FancyZonesInstallFolder" Name="$(var.FancyZonesProjectName)" />
<Directory Id="KeyboardManagerInstallFolder" Name="$(var.KeyboardManagerProjectName)" />
<Directory Id="LauncherInstallFolder" Name="launcher">
<Directory Id="AssetsFolder" Name="Assets" />
<Directory Id="LauncherImagesFolder" Name="Images" />
<Directory Id="LauncherUIControlsFolder" Name="Microsoft.Toolkit.Uwp.UI.Controls" />
<Directory Id="LauncherXamlUIFolder" Name="Microsoft.UI.Xaml">
<Directory Id="XamlUIAssetsFolder" Name="Assets" />
</Directory>
<Directory Id="LauncherImagesFolder" Name="Images" />
<Directory Id="LauncherpinyindbFolder" Name="pinyindb" />
<Directory Id="LauncherPluginsFolder" Name="Plugins">
<Directory Id="CalculatorPluginFolder" Name="Microsoft.Plugin.Calculator">
@@ -381,134 +384,30 @@
</DirectoryRef>
<DirectoryRef Id="FancyZonesInstallFolder" FileSource="$(var.BinX64Dir)modules\">
<Component Id="Module_FancyZones" Guid="C6B5272E-6ED4-4B80-B0E7-2FF0355D8CF4" Win64="yes">
<File Source="$(var.BinX64Dir)modules\fancyzones.dll" KeyPath="yes" />
<File Source="$(var.BinX64Dir)modules\FancyZones\FancyZonesEditor.exe" >
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\fancyzones.dll" KeyPath="yes" />
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\FancyZonesEditor.exe" >
<netfx:NativeImage Id="FancyZonesEditor.exe" Platform="64bit" Priority="0" />
</File>
<File Source="$(var.BinX64Dir)modules\FancyZones\ControlzEx.dll" />
<File Source="$(var.BinX64Dir)modules\FancyZones\MahApps.Metro.dll" />
<File Source="$(var.BinX64Dir)modules\FancyZones\Microsoft.Xaml.Behaviors.dll" />
<File Source="$(var.BinX64Dir)modules\FancyZones\FancyZonesEditor.exe.config" />
<File Source="$(var.BinX64Dir)modules\FancyZones\Microsoft.Bcl.AsyncInterfaces.dll" />
<File Source="$(var.BinX64Dir)modules\FancyZones\System.Buffers.dll" />
<File Source="$(var.BinX64Dir)modules\FancyZones\System.Memory.dll" />
<File Source="$(var.BinX64Dir)modules\FancyZones\System.Numerics.Vectors.dll" />
<File Source="$(var.BinX64Dir)modules\FancyZones\System.Runtime.CompilerServices.Unsafe.dll" />
<File Source="$(var.BinX64Dir)modules\FancyZones\System.Text.Encodings.Web.dll" />
<File Source="$(var.BinX64Dir)modules\FancyZones\System.Text.Json.dll" />
<File Source="$(var.BinX64Dir)modules\FancyZones\System.Threading.Tasks.Extensions.dll" />
<File Source="$(var.BinX64Dir)modules\FancyZones\System.ValueTuple.dll" />
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\ControlzEx.dll" />
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\MahApps.Metro.dll" />
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\Microsoft.Xaml.Behaviors.dll" />
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\FancyZonesEditor.exe.config" />
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\Microsoft.Bcl.AsyncInterfaces.dll" />
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\System.Buffers.dll" />
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\System.Memory.dll" />
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\System.Numerics.Vectors.dll" />
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\System.Runtime.CompilerServices.Unsafe.dll" />
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\System.Text.Encodings.Web.dll" />
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\System.Text.Json.dll" />
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\System.Threading.Tasks.Extensions.dll" />
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\System.ValueTuple.dll" />
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\ManagedCommon.dll" />
<File Id="FancyZones_Telemetry.dll" Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\Telemetry.dll" />
</Component>
</DirectoryRef>
<DirectoryRef Id="ModulesInstallFolder" FileSource="$(var.BinX64Dir)modules\">
<Component Id="Module_ShortcutGuide" Guid="CBD0AC09-91D3-428E-B2B3-05745ADF3473" Win64="yes">
<File Source="$(var.BinX64Dir)modules\shortcut_guide.dll" KeyPath="yes" />
</Component>
<Component Id="Module_PowerRename" Guid="E4401D08-27FE-4F96-BA17-0C61FD79E684" Win64="yes">
<File Source="$(var.BinX64Dir)modules\PowerRenameExt.dll" KeyPath="yes" />
<RegistryKey Root="HKCR" Key="CLSID\{0440049F-D1DC-4E46-B27B-98393D79486B}">
<RegistryValue Type="string" Value="PowerRename Shell Extension" />
<RegistryValue Type="string" Key="InprocServer32" Value="[ModulesInstallFolder]PowerRenameExt.dll" />
<RegistryValue Type="string" Key="InprocServer32" Name="ThreadingModel" Value="Apartment" />
</RegistryKey>
<RegistryKey Root="HKCR" Key="AllFileSystemObjects\ShellEx\ContextMenuHandlers\PowerRenameExt">
<RegistryValue Type="string" Value="{0440049F-D1DC-4E46-B27B-98393D79486B}"/>
</RegistryKey>
</Component>
<Component Id="Module_Launcher" Guid="9A343236-B49D-451D-A27D-4C336F460A45" Win64="yes">
<File Source="$(var.BinX64Dir)modules\Microsoft.Launcher.dll" />
</Component>
<Component Id="Module_KeyboardManager" Guid="9279BD82-786F-4F0B-8E49-DB484EE34C9B" Win64="yes">
<File Source="$(var.BinX64Dir)modules\KeyboardManager.dll" />
</Component>
<Component Id="Module_ImageResizer" Guid="96E63289-759C-4A73-A56B-EE7429932F72" Win64="yes">
<File Source="$(var.BinX64Dir)modules\ImageResizer.exe">
<netfx:NativeImage Id="ImageResizer.exe" Platform="all" Priority="0" />
</File>
<File Source="$(var.BinX64Dir)modules\GalaSoft.MvvmLight.dll" />
<File Source="$(var.BinX64Dir)modules\GalaSoft.MvvmLight.Platform.dll" />
<File Source="$(var.BinX64Dir)modules\GalaSoft.MvvmLight.Extras.dll" />
<File Source="$(var.BinX64Dir)modules\System.Windows.Interactivity.dll">
<!-- NB: Needed since it's only referenced in XAML. -->
<netfx:NativeImage Id="Interactivity" Platform="all" Priority="0"/>
</File>
<File Source="$(var.BinX64Dir)modules\Newtonsoft.Json.dll" />
<File Source="$(var.BinX64Dir)modules\ImageResizerExt.dll" KeyPath="yes" />
<!-- VCRuntime -->
<?foreach File in vcruntime140.dll;vcruntime140_1.dll;concrt140.dll;msvcp140.dll;msvcp140_1.dll;msvcp140_2.dll;msvcp140_codecvt_ids.dll;vccorlib140.dll?>
<File Id="ImageResizer_$(var.File)" Source="$(var.RepoDir)installer\VCRuntime\$(var.File)" />
<?endforeach?>
</Component>
<Component Id="Module_ImageResizer_Registry" Guid="8B593E2C-2D9B-4EBC-93F7-A2B69707DAC9" Win64="yes">
<RegistryKey Root="HKCR" Key="CLSID\{51B4D7E5-7568-4234-B4BB-47FB3C016A69}\InprocServer32">
<RegistryValue Value="[ModulesInstallFolder]ImageResizerExt.dll" Type="string" />
<RegistryValue Name="ThreadingModel" Value="Apartment" Type="string" />
</RegistryKey>
<!-- Registry Key for the drag and drop handler -->
<RegistryValue Root="HKCR"
Key="Directory\ShellEx\DragDropHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<!-- Registry Keys for the context menu handler for each of the following image formats: bmp, dib, gif, jfif, jpe, jpeg, jpg, jxr, png, rle, tif, tiff, wdp -->
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.bmp\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.dib\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.gif\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.jfif\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.jpe\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.jpeg\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.jpg\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.jxr\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.png\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.rle\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.tif\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.tiff\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.wdp\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
</Component>
<Component Id="Module_PowerPreview_PerUserRegistry" Guid="CD90ADC0-7CD5-4A62-B0AF-23545C1E6DD3" Win64="yes">
<!-- Added a separate component for Per-User registry changes -->
<!-- Registry Key for Class Registration of Svg Preview Handler -->
@@ -571,7 +470,119 @@
</RegistryKey>
</Component>
</DirectoryRef>
<DirectoryRef Id="ImageResizerInstallFolder" FileSource="$(var.BinX64Dir)modules\$(var.ImageResizerProjectName)">
<Component Id="Module_ImageResizer" Guid="96E63289-759C-4A73-A56B-EE7429932F72" Win64="yes">
<File Source="$(var.BinX64Dir)modules\$(var.ImageResizerProjectName)\ImageResizer.exe">
<netfx:NativeImage Id="ImageResizer.exe" Platform="all" Priority="0" />
</File>
<File Source="$(var.BinX64Dir)modules\$(var.ImageResizerProjectName)\GalaSoft.MvvmLight.dll" />
<File Source="$(var.BinX64Dir)modules\$(var.ImageResizerProjectName)\GalaSoft.MvvmLight.Platform.dll" />
<File Source="$(var.BinX64Dir)modules\$(var.ImageResizerProjectName)\GalaSoft.MvvmLight.Extras.dll" />
<File Source="$(var.BinX64Dir)modules\$(var.ImageResizerProjectName)\System.Windows.Interactivity.dll">
<!-- NB: Needed since it's only referenced in XAML. -->
<netfx:NativeImage Id="Interactivity" Platform="all" Priority="0"/>
</File>
<File Source="$(var.BinX64Dir)modules\$(var.ImageResizerProjectName)\Newtonsoft.Json.dll" />
<File Source="$(var.BinX64Dir)modules\$(var.ImageResizerProjectName)\ImageResizerExt.dll" KeyPath="yes" />
<!-- VCRuntime -->
<?foreach File in vcruntime140.dll;vcruntime140_1.dll;concrt140.dll;msvcp140.dll;msvcp140_1.dll;msvcp140_2.dll;msvcp140_codecvt_ids.dll;vccorlib140.dll?>
<File Id="ImageResizer_$(var.File)" Source="$(var.RepoDir)installer\VCRuntime\$(var.File)" />
<?endforeach?>
</Component>
<Component Id="Module_ImageResizer_Registry" Guid="8B593E2C-2D9B-4EBC-93F7-A2B69707DAC9" Win64="yes">
<RegistryKey Root="HKCR" Key="CLSID\{51B4D7E5-7568-4234-B4BB-47FB3C016A69}\InprocServer32">
<RegistryValue Value="[ImageResizerInstallFolder]ImageResizerExt.dll" Type="string" />
<RegistryValue Name="ThreadingModel" Value="Apartment" Type="string" />
</RegistryKey>
<!-- Registry Key for the drag and drop handler -->
<RegistryValue Root="HKCR"
Key="Directory\ShellEx\DragDropHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<!-- Registry Keys for the context menu handler for each of the following image formats: bmp, dib, gif, jfif, jpe, jpeg, jpg, jxr, png, rle, tif, tiff, wdp -->
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.bmp\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.dib\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.gif\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.jfif\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.jpe\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.jpeg\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.jpg\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.jxr\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.png\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.rle\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.tif\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.tiff\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
<RegistryValue Root="HKCR"
Key="SystemFileAssociations\.wdp\ShellEx\ContextMenuHandlers\ImageResizer"
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
Type="string" />
</Component>
</DirectoryRef>
<DirectoryRef Id="PowerRenameInstallFolder" FileSource="$(var.BinX64Dir)modules\$(var.PowerRenameProjectName)">
<Component Id="Module_PowerRename" Guid="E4401D08-27FE-4F96-BA17-0C61FD79E684" Win64="yes">
<File Source="$(var.BinX64Dir)modules\$(var.PowerRenameProjectName)\PowerRenameExt.dll" KeyPath="yes" />
<RegistryKey Root="HKCR" Key="CLSID\{0440049F-D1DC-4E46-B27B-98393D79486B}">
<RegistryValue Type="string" Value="PowerRename Shell Extension" />
<RegistryValue Type="string" Key="InprocServer32" Value="[PowerRenameInstallFolder]PowerRenameExt.dll" />
<RegistryValue Type="string" Key="InprocServer32" Name="ThreadingModel" Value="Apartment" />
</RegistryKey>
<RegistryKey Root="HKCR" Key="AllFileSystemObjects\ShellEx\ContextMenuHandlers\PowerRenameExt">
<RegistryValue Type="string" Value="{0440049F-D1DC-4E46-B27B-98393D79486B}"/>
</RegistryKey>
</Component>
</DirectoryRef>
<DirectoryRef Id="ShortcutGuideInstallFolder" FileSource="$(var.BinX64Dir)modules\$(var.ShortcutGuideProjectName)\">
<Component Id="Module_ShortcutGuide" Guid="CBD0AC09-91D3-428E-B2B3-05745ADF3473" Win64="yes">
<File Source="$(var.BinX64Dir)modules\$(var.ShortcutGuideProjectName)\$(var.ShortcutGuideProjectName).dll" KeyPath="yes" />
</Component>
</DirectoryRef>
<DirectoryRef Id="KeyboardManagerInstallFolder" FileSource="$(var.BinX64Dir)modules\$(var.KeyboardManagerProjectName)\">
<Component Id="Module_KeyboardManager" Guid="9279BD82-786F-4F0B-8E49-DB484EE34C9B" Win64="yes">
<File Source="$(var.BinX64Dir)modules\$(var.KeyboardManagerProjectName)\KeyboardManager.dll" />
</Component>
</DirectoryRef>
<DirectoryRef Id="FileExplorerPreviewInstallFolder" FileSource="$(var.RepoDir)\modules\FileExplorerPreview\">
<Component Id="Module_PowerPreview" Guid="FF1700D5-1B07-4E07-9A62-4D206645EEA9" Win64="yes">
<!-- Component to include PowerPreview Module Source dll's -->
@@ -601,7 +612,7 @@
<File Source="$(var.BinX64Dir)SettingsUIRunner\Microsoft.PowerToys.Settings.UI.Runner.exe"/>
<File Source="$(var.BinX64Dir)SettingsUIRunner\Microsoft.PowerToys.Settings.UI.exe"/>
<!-- dll -->
<?foreach File in concrt140_app.dll;Microsoft.Bcl.AsyncInterfaces.dll;Microsoft.PowerToys.Settings.UI.Lib.dll;Microsoft.PowerToys.Settings.UI.Runner.dll;Microsoft.Toolkit.dll;Microsoft.Toolkit.Uwp.dll;Microsoft.Toolkit.Uwp.UI.dll;Microsoft.Toolkit.Win32.UI.XamlHost.dll;Microsoft.Toolkit.Win32.UI.XamlHost.Managed.dll;Microsoft.Toolkit.Wpf.UI.Controls.dll;Microsoft.Toolkit.Wpf.UI.XamlHost.dll;Microsoft.UI.Xaml.dll;Microsoft.Xaml.Interactions.dll;Microsoft.Xaml.Interactivity.dll;msvcp140_1_app.dll;msvcp140_2_app.dll;msvcp140_app.dll;Newtonsoft.Json.dll;PowerToysInterop.dll;System.Runtime.CompilerServices.Unsafe.dll;System.Runtime.dll;System.Text.Encodings.Web.dll;System.Text.Json.dll;vcamp140_app.dll;vccorlib140_app.dll;vcomp140_app.dll;vcruntime140_1_app.dll;vcruntime140_app.dll;Telemetry.dll?>
<?foreach File in concrt140_app.dll;Microsoft.Bcl.AsyncInterfaces.dll;Microsoft.PowerToys.Settings.UI.Lib.dll;Microsoft.PowerToys.Settings.UI.Runner.dll;Microsoft.Toolkit.dll;Microsoft.Toolkit.Uwp.dll;Microsoft.Toolkit.Uwp.UI.dll;Microsoft.Toolkit.Win32.UI.XamlHost.dll;Microsoft.Toolkit.Win32.UI.XamlHost.Managed.dll;Microsoft.Toolkit.Wpf.UI.Controls.dll;Microsoft.Toolkit.Wpf.UI.XamlHost.dll;Microsoft.UI.Xaml.dll;Microsoft.Xaml.Interactions.dll;Microsoft.Xaml.Interactivity.dll;msvcp140_1_app.dll;msvcp140_2_app.dll;msvcp140_app.dll;Newtonsoft.Json.dll;PowerToysInterop.dll;System.Runtime.CompilerServices.Unsafe.dll;System.Runtime.dll;System.Text.Encodings.Web.dll;System.Text.Json.dll;vcamp140_app.dll;vccorlib140_app.dll;vcomp140_app.dll;vcruntime140_1_app.dll;vcruntime140_app.dll;Telemetry.dll;ManagedCommon.dll?>
<File Id="SettingsV2_$(var.File)" Source="$(var.BinX64Dir)SettingsUIRunner\$(var.File)" />
<?endforeach?>
<!-- json -->
@@ -655,7 +666,7 @@
</DirectoryRef>
<DirectoryRef Id="SettingsV2StylesInstallFolder" FileSource="$(var.BinX64Dir)SettingsUIRunner\Styles">
<Component Id="SettingsV2Styles" Guid="44B5C0E0-76DA-4604-BB86-FCD27A00EB71" Win64="yes">
<?foreach File in Page.xbf;TextBlock.xbf;_Colors.xbf;_FontSizes.xbf;_Sizes.xbf;_Thickness.xbf?>
<?foreach File in Page.xbf;TextBlock.xbf;_Colors.xbf;_FontSizes.xbf;_Sizes.xbf;_Thickness.xbf;Button.xbf?>
<File Id="SettingsV2_Styles_$(var.File)" Source="$(var.BinX64Dir)SettingsUIRunner\Styles\$(var.File)" />
<?endforeach?>
</Component>
@@ -729,7 +740,6 @@
<ComponentRef Id="Module_ImageResizer_Registry" />
<ComponentRef Id="Module_PowerPreview" />
<ComponentRef Id="Module_PowerPreview_PerUserRegistry" />
<ComponentRef Id="Module_Launcher" />
<ComponentRef Id="Module_KeyboardManager" />
<ComponentRef Id="SettingsV2" />
<ComponentRef Id="SettingsV2Assets" />
@@ -761,7 +771,7 @@
<?define IdSafeLanguage = $(var.Language)?>
<?endif?>
<Component Id="Resources_$(var.IdSafeLanguage)_Component" Directory="Resources$(var.IdSafeLanguage)Folder">
<File Id="Resources_ImageResizer_$(var.IdSafeLanguage)_File" Source="$(var.BinX64Dir)modules\$(var.Language)\ImageResizer.resources.dll" />
<File Id="Resources_ImageResizer_$(var.IdSafeLanguage)_File" Source="$(var.BinX64Dir)modules\$(var.ImageResizerProjectName)\$(var.Language)\ImageResizer.resources.dll" />
</Component>
<?undef IdSafeLanguage?>
<?endforeach?>
@@ -770,7 +780,8 @@
<Fragment>
<ComponentGroup Id="LauncherComponents">
<Component Id="launcherInstallComponent" Directory="LauncherInstallFolder" Guid="5E688DB4-C522-4268-BA54-ED1CDFFE9DB6">
<?foreach File in App.xbf;ColorCode.Core.dll;ColorCode.UWP.dll;ColorCode.UWP.pri;concrt140_app.dll;ICSharpCode.SharpZipLib.dll;JetBrains.Annotations.dll;LauncherControl.xbf;Mages.Core.dll;Microsoft.Graphics.Canvas.dll;Microsoft.Graphics.Canvas.winmd;Microsoft.Search.Interop.dll;Microsoft.Toolkit.dll;Microsoft.Toolkit.Parsers.dll;Microsoft.Toolkit.Uwp.dll;Microsoft.Toolkit.Uwp.pri;Microsoft.Toolkit.Uwp.UI.Animations.dll;Microsoft.Toolkit.Uwp.UI.Animations.pri;Microsoft.Toolkit.Uwp.UI.Controls.dll;Microsoft.Toolkit.Uwp.UI.Controls.pri;Microsoft.Toolkit.Uwp.UI.dll;Microsoft.Toolkit.Uwp.UI.pri;Microsoft.Toolkit.Win32.UI.XamlHost.dll;Microsoft.Toolkit.Win32.UI.XamlHost.Managed.dll;Microsoft.Toolkit.Win32.UI.XamlHost.pri;Microsoft.Toolkit.Win32.UI.XamlHost.winmd;Microsoft.Toolkit.Win32.UI.XamlHost.xml;Microsoft.Toolkit.Wpf.UI.XamlHost.dll;Microsoft.UI.Xaml.dll;Microsoft.UI.Xaml.pri;Microsoft.UI.Xaml.winmd;Microsoft.Xaml.Interactions.dll;Microsoft.Xaml.Interactions.pri;Microsoft.Xaml.Interactivity.dll;Microsoft.Xaml.Interactivity.pri;Mono.Cecil.dll;Mono.Cecil.Mdb.dll;Mono.Cecil.Pdb.dll;Mono.Cecil.Rocks.dll;msvcp140_1_app.dll;msvcp140_2_app.dll;msvcp140_app.dll;netstandard.dll;Newtonsoft.Json.dll;NHotkey.dll;NHotkey.Wpf.dll;NLog.dll;NLog.Extensions.Logging.dll;NoiseAsset_256x256_PNG.png;Pinyin4Net.dll;PowerLauncher.deps.json;PowerLauncher.dll;PowerLauncher.exe;PowerLauncher.runtimeconfig.json;PowerLauncher.UI.exe;PowerLauncher.UI.xr.xml;resources.pri;ResultList.xbf;SQLite.Interop.dll;System.ComponentModel.Composition.dll;System.Data.OleDb.dll;System.Data.SqlClient.dll;System.Data.SQLite.dll;System.IO.Ports.dll;System.Net.Http.Rtc.dll;System.Numerics.Vectors.WindowsRuntime.dll;System.Private.Reflection.Metadata.Ecma335.dll;System.Private.ServiceModel.dll;System.Reflection.Context.dll;System.Security.Permissions.dll;System.ServiceModel.dll;System.ServiceModel.Duplex.dll;System.ServiceModel.Http.dll;System.ServiceModel.NetTcp.dll;System.ServiceModel.Primitives.dll;System.ServiceModel.Security.dll;vcamp140_app.dll;vccorlib140_app.dll;vcomp140_app.dll;vcruntime140_1_app.dll;vcruntime140_app.dll;WindowsInput.dll;Wox.Core.dll;Wox.dll;Wox.Infrastructure.dll;Wox.Plugin.dll;PowerToysInterop.dll;Telemetry.dll;PowerLauncher.Telemetry.dll;PropertyChanged.dll;Microsoft.Extensions.Configuration.Abstractions.dll;Microsoft.Extensions.Configuration.Binder.dll;Microsoft.Extensions.Configuration.dll;Microsoft.Extensions.DependencyInjection.Abstractions.dll;Microsoft.Extensions.DependencyInjection.dll;Microsoft.Extensions.Logging.Abstractions.dll;Microsoft.Extensions.Logging.dll;Microsoft.Extensions.Options.dll;Microsoft.Extensions.Primitives.dll?>
<File Source="$(var.BinX64Dir)modules\Launcher\Microsoft.Launcher.dll" />
<?foreach File in concrt140_app.dll;ICSharpCode.SharpZipLib.dll;JetBrains.Annotations.dll;Mages.Core.dll;Microsoft.Search.Interop.dll;EntityFramework.SqlServer.dll;EntityFramework.dll;Mono.Cecil.dll;Mono.Cecil.Mdb.dll;Mono.Cecil.Pdb.dll;Mono.Cecil.Rocks.dll;msvcp140_1_app.dll;msvcp140_2_app.dll;msvcp140_app.dll;Newtonsoft.Json.dll;NLog.dll;NLog.Extensions.Logging.dll;Pinyin4Net.dll;PowerLauncher.deps.json;PowerLauncher.dll;PowerLauncher.exe;Microsoft.Xaml.Behaviors.dll;System.Text.Json.dll;sni.dll;System.Data.SQLite.EF6.dll;PowerLauncher.runtimeconfig.json;SQLite.Interop.dll;System.Data.OleDb.dll;System.Data.SqlClient.dll;System.Data.SQLite.dll;vcamp140_app.dll;vccorlib140_app.dll;vcomp140_app.dll;vcruntime140_1_app.dll;vcruntime140_app.dll;WindowsInput.dll;Wox.Core.dll;Wox.dll;Wox.Infrastructure.dll;Wox.Plugin.dll;PowerToysInterop.dll;Telemetry.dll;PowerLauncher.Telemetry.dll;PropertyChanged.dll;Microsoft.Extensions.Configuration.Abstractions.dll;Microsoft.Extensions.Configuration.Binder.dll;Microsoft.Extensions.Configuration.dll;Microsoft.Extensions.DependencyInjection.Abstractions.dll;Microsoft.Extensions.DependencyInjection.dll;Microsoft.Extensions.Logging.Abstractions.dll;Microsoft.Extensions.Logging.dll;Microsoft.Extensions.Options.dll;Microsoft.Extensions.Primitives.dll;ControlzEx.dll;MahApps.Metro.dll;ManagedCommon.dll?>
<File Id="File_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\$(var.File)" />
<?endforeach?>
<File Source="$(var.BinX64Dir)SettingsUIRunner\Microsoft.PowerToys.Settings.UI.Lib.dll" />
@@ -779,40 +790,27 @@
<File Id="File_$(var.File)" Source="$(var.RepoDir)installer\VCRuntime\$(var.File)" />
<?endforeach?>
</Component>
<Component Id="launcherAssetsComponent" Directory="AssetsFolder" Guid="6A86A414-D68B-49F0-A7AD-A342528D7ACD">
<?foreach File in LockScreenLogo.scale-200.png;SplashScreen.scale-200.png;Square150x150Logo.scale-200.png;Square44x44Logo.scale-200.png;Square44x44Logo.targetsize-24_altform-unplated.png;StoreLogo.png;Wide310x150Logo.scale-200.png?>
<File Source="$(var.BinX64Dir)modules\launcher\Assets\$(var.File)" />
<?endforeach?>
</Component>
<Component Id="launcherImagesComponent" Directory="LauncherImagesFolder" Guid="D254220C-1DD9-4C74-8810-1AAB2F940DE8">
<?foreach File in app.png;app_error.png;Browser.png;calculator.png;cancel.png;close.png;cmd.png;color.png;copy.png;down.png;EXE.png;file.png;find.png;folder.png;history.png;image.png;Link.png;lock.png;logoff.png;ok.png;open.png;plugin.png;recyclebin.png;restart.png;search.png;settings.png;shutdown.png;sleep.png;up.png;update.png;warning.png?>
<File Id="File_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\Images\$(var.File)" />
<?endforeach?>
<File Source="$(var.BinX64Dir)modules\launcher\Images\New Message.png" />
</Component>
<Component Id="launcherUIControlsComponent" Directory="LauncherUIControlsFolder" Guid="9C6C3785-D6FB-468A-9BEC-130F0403E7F8">
<File Source="$(var.BinX64Dir)modules\launcher\Microsoft.Toolkit.Uwp.UI.Controls\Microsoft.Toolkit.Uwp.UI.Controls.xr.xml" />
</Component>
<Component Id="launcherXamlAssetsComponent" Directory="XamlUIAssetsFolder" Guid="C7ECA65E-73D3-4C02-A6FA-FD1E3215CC48">
<File Source="$(var.BinX64Dir)modules\launcher\Microsoft.UI.Xaml\Assets\NoiseAsset_256X256_PNG.png" />
</Component>
<Component Id="launcherpinyinComponent" Directory="LauncherpinyindbFolder" Guid="F9EA53C7-D6AE-4E62-9800-0D32FBBD9F65">
<?foreach File in pinyin_gwoyeu_mapping.xml;pinyin_mapping.xml;unicode_to_hanyu_pinyin.txt?>
<File Source="$(var.BinX64Dir)modules\launcher\pinyindb\$(var.File)" />
<?endforeach?>
</Component>
<Component Id="launcherPropertiesComponent" Directory="LauncherPropertiesFolder" Guid="5C18CDB8-DBBB-4D53-A935-943347BC6310">
<File Source="$(var.BinX64Dir)modules\launcher\Properties\Default.rd.xml" />
</Component>
<!-- Calculator Plugin -->
<Component Id="calculatorComponent" Directory="CalculatorPluginFolder" Guid="19DE1022-583C-4969-9AFC-D43CB944003D">
<?foreach File in plugin.json;Wox.Infrastructure.dll;Microsoft.Plugin.Caculator.deps.json;Microsoft.Plugin.Caculator.dll;Wox.Plugin.dll?>
<File Id="Calculator_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Caculator\$(var.File)" />
<?foreach File in plugin.json;Wox.Infrastructure.dll;Microsoft.Plugin.Calculator.deps.json;Microsoft.Plugin.Calculator.dll;Wox.Plugin.dll;Telemetry.dll?>
<File Id="Calculator_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Calculator\$(var.File)" />
<?endforeach?>
</Component>
<Component Id="calculatorImagesComponent" Directory="CalculatorImagesFolder" Guid="07EC9232-CF9A-4CDB-8D8E-E79DC75096C0">
<File Id="calculatorPluginImg" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Caculator\Images\calculator.png" />
<File Id="calculatorPluginImg_calculator_light" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Calculator\Images\calculator_light.png" />
<File Id="calculatorPluginImg_calculator_dark" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Calculator\Images\calculator_dark.png" />
</Component>
<Component Id="calculatorLanguagesComponent" Directory="CalculatorLanguagesFolder" Guid="2D8019E7-664F-4529-9FAA-83C8DACF0732">
<?foreach LanguageFile in de.xaml;en.xaml;pl.xaml;tr.xaml;zh-cn.xaml;zh-tw.xaml?>
@@ -824,19 +822,19 @@
<?else?>
<?define IdSafeLanguage = $(var.LanguageFile)?>
<?endif?>
<File Id="File_calc_Plugin_$(var.IdSafeLanguage)" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Caculator\Languages\$(var.LanguageFile)" />
<File Id="File_calc_Plugin_$(var.IdSafeLanguage)" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Calculator\Languages\$(var.LanguageFile)" />
<?undef IdSafeLanguage?>
<?endforeach?>
</Component>
<Component Id="calculatorpinyindbComponent" Directory="CalculatorpinyindbFolder" Guid="D5527670-BE9A-4AA9-9D36-1249F2184B5B">
<?foreach File in pinyin_gwoyeu_mapping.xml;pinyin_mapping.xml;unicode_to_hanyu_pinyin.txt?>
<File Id="CalcPlugin_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Caculator\pinyindb\$(var.File)" />
<File Id="CalcPlugin_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Calculator\pinyindb\$(var.File)" />
<?endforeach?>
</Component>
<!-- Folder Plugin -->
<Component Id="FolderComponent" Directory="FolderPluginFolder" Guid="453D6C29-8F0D-46EC-B210-82E6AF547039">
<?foreach File in plugin.json;Wox.Infrastructure.dll;Microsoft.Plugin.Folder.deps.json;Microsoft.Plugin.Folder.dll;Wox.Plugin.dll?>
<?foreach File in plugin.json;Wox.Infrastructure.dll;Microsoft.Plugin.Folder.deps.json;Microsoft.Plugin.Folder.dll;Wox.Plugin.dll;Telemetry.dll?>
<File Id="Folder_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Folder\$(var.File)" />
<?endforeach?>
</Component>
@@ -867,7 +865,7 @@
<!-- Program Plugin -->
<Component Id="ProgramComponent" Directory="ProgramPluginFolder" Guid="3C5CA6E6-3D36-4F4E-B40E-38AA5E5CB799">
<?foreach File in plugin.json;Wox.Infrastructure.dll;Wox.Plugin.dll;Microsoft.Plugin.Program.deps.json;Microsoft.Plugin.Program.dll?>
<?foreach File in plugin.json;Wox.Infrastructure.dll;Wox.Plugin.dll;Microsoft.Plugin.Program.deps.json;Microsoft.Plugin.Program.dll;Telemetry.dll?>
<File Id="Program_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Program\$(var.File)" />
<?endforeach?>
</Component>
@@ -898,7 +896,7 @@
<!-- Shell Plugin -->
<Component Id="ShellComponent" Directory="ShellPluginFolder" Guid="6D3D7294-1804-47C9-83E5-47A8867F3801">
<?foreach File in plugin.json;Wox.Infrastructure.dll;Wox.Plugin.dll;Microsoft.Plugin.Shell.deps.json;Microsoft.Plugin.Shell.dll?>
<?foreach File in plugin.json;Wox.Infrastructure.dll;Wox.Plugin.dll;Microsoft.Plugin.Shell.deps.json;Microsoft.Plugin.Shell.dll;Telemetry.dll?>
<File Id="Shell_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Shell\$(var.File)" />
<?endforeach?>
</Component>
@@ -928,7 +926,7 @@
<!-- Indexer Plugin -->
<Component Id="IndexerComponent" Directory="IndexerPluginFolder" Guid="FEA9816A-B4F7-42CC-99AF-B05F3E7F7EBF">
<?foreach File in Microsoft.Plugin.Indexer.deps.json;Microsoft.Plugin.Indexer.dll;plugin.json;Wox.Infrastructure.dll?>
<?foreach File in Microsoft.Plugin.Indexer.deps.json;Microsoft.Plugin.Indexer.dll;plugin.json;Wox.Infrastructure.dll;Telemetry.dll?>
<File Id="Indexer_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Indexer\$(var.File)" />
<?endforeach?>
</Component>
@@ -943,7 +941,7 @@
<!-- WindowWalker Plugin -->
<Component Id="WindowWalkerComponent" Directory="WindowWalkerPluginFolder" Guid="EB1391C9-B701-421F-80FC-ABB2FEDFAD19">
<?foreach File in plugin.json;Wox.Infrastructure.dll;Wox.Plugin.dll;Microsoft.Plugin.WindowWalker.deps.json;Microsoft.Plugin.WindowWalker.dll?>
<?foreach File in plugin.json;Wox.Infrastructure.dll;Wox.Plugin.dll;Microsoft.Plugin.WindowWalker.deps.json;Microsoft.Plugin.WindowWalker.dll;Telemetry.dll?>
<File Id="WindowWalker_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.WindowWalker\$(var.File)" />
<?endforeach?>
</Component>
@@ -961,4 +959,4 @@
</ComponentGroup>
</Fragment>
</Wix>
</Wix>

View File

@@ -0,0 +1,63 @@
setlocal enableDelayedExpansion
IF NOT DEFINED PTRoot (SET PTRoot=..\..)
rem Publish Settings
SET settingsProfileFolderName=!PTRoot!\src\core\Microsoft.PowerToys.Settings.UI.Runner\Properties\PublishProfiles\
rem Create the publish profile folder if it doesn't exist
IF NOT EXIST !settingsProfileFolderName! (mkdir !settingsProfileFolderName!)
SET settingsProfileFileName=SettingsProfile.pubxml
SET settingsPublishProfile=!settingsProfileFolderName!!settingsProfileFileName!
rem Create the publish profile pubxml
echo ^<?xml version="1.0" encoding="utf-8"?^> > !settingsPublishProfile!
echo ^<^^!-- >> !settingsPublishProfile!
echo https://go.microsoft.com/fwlink/?LinkID=208121. >> !settingsPublishProfile!
echo --^> >> !settingsPublishProfile!
echo ^<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"^> >> !settingsPublishProfile!
echo ^<PropertyGroup^> >> !settingsPublishProfile!
echo ^<PublishProtocol^>FileSystem^</PublishProtocol^> >> !settingsPublishProfile!
echo ^<Configuration^>Release^</Configuration^> >> !settingsPublishProfile!
echo ^<Platform^>x64^</Platform^> >> !settingsPublishProfile!
echo ^<TargetFramework^>netcoreapp3.1^</TargetFramework^> >> !settingsPublishProfile!
echo ^<PublishDir^>..\..\..\x64\Release\SettingsUIRunner^</PublishDir^> >> !settingsPublishProfile!
echo ^<RuntimeIdentifier^>win-x64^</RuntimeIdentifier^> >> !settingsPublishProfile!
echo ^<SelfContained^>false^</SelfContained^> >> !settingsPublishProfile!
echo ^<PublishSingleFile^>False^</PublishSingleFile^> >> !settingsPublishProfile!
echo ^<PublishReadyToRun^>False^</PublishReadyToRun^> >> !settingsPublishProfile!
echo ^</PropertyGroup^> >> !settingsPublishProfile!
echo ^</Project^> >> !settingsPublishProfile!
rem In case of Release we should not use Debug CRT in VCRT forwarders
msbuild !PTRoot!\src\core\Microsoft.PowerToys.Settings.UI.Runner\Microsoft.PowerToys.Settings.UI.Runner.csproj -t:Publish -p:Configuration="Release" -p:Platform="x64" -p:AppxBundle=Never -p:VCRTForwarders-IncludeDebugCRT=false -p:PublishProfile=!settingsProfileFileName!
rem Publish Launcher
SET launcherProfileFolderName=!PTRoot!\src\modules\launcher\PowerLauncher\Properties\PublishProfiles\
rem Create the publish profile folder if it doesn't exist
IF NOT EXIST !launcherProfileFolderName! (mkdir !launcherProfileFolderName!)
SET launcherProfileFileName=LauncherProfile.pubxml
SET launcherPublishProfile=!launcherProfileFolderName!!launcherProfileFileName!
rem Create the publish profile pubxml
echo ^<?xml version="1.0" encoding="utf-8"?^> > !launcherPublishProfile!
echo ^<^^!-- >> !launcherPublishProfile!
echo https://go.microsoft.com/fwlink/?LinkID=208121. >> !launcherPublishProfile!
echo --^> >> !launcherPublishProfile!
echo ^<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"^> >> !launcherPublishProfile!
echo ^<PropertyGroup^> >> !launcherPublishProfile!
echo ^<PublishProtocol^>FileSystem^</PublishProtocol^> >> !launcherPublishProfile!
echo ^<Configuration^>Release^</Configuration^> >> !launcherPublishProfile!
echo ^<Platform^>x64^</Platform^> >> !launcherPublishProfile!
echo ^<TargetFramework^>netcoreapp3.1^</TargetFramework^> >> !launcherPublishProfile!
echo ^<PublishDir^>..\..\..\..\x64\Release\modules\launcher^</PublishDir^> >> !launcherPublishProfile!
echo ^<RuntimeIdentifier^>win-x64^</RuntimeIdentifier^> >> !launcherPublishProfile!
echo ^<SelfContained^>false^</SelfContained^> >> !launcherPublishProfile!
echo ^<PublishSingleFile^>False^</PublishSingleFile^> >> !launcherPublishProfile!
echo ^<PublishReadyToRun^>False^</PublishReadyToRun^> >> !launcherPublishProfile!
echo ^</PropertyGroup^> >> !launcherPublishProfile!
echo ^</Project^> >> !launcherPublishProfile!
rem In case of Release we should not use Debug CRT in VCRT forwarders
msbuild !PTRoot!\src\modules\launcher\PowerLauncher\PowerLauncher.csproj -t:Publish -p:Configuration="Release" -p:Platform="x64" -p:AppxBundle=Never -p:VCRTForwarders-IncludeDebugCRT=false -p:PublishProfile=!launcherProfileFileName!

View File

@@ -54,7 +54,6 @@
<PreprocessorDefinitions>WIN64;_DEBUG;_WINDOWS;_USRDLL;CUSTOMACTIONTEST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<LanguageStandard>stdcpplatest</LanguageStandard>
@@ -77,7 +76,6 @@
<PreprocessorDefinitions>WIN64;NDEBUG;_WINDOWS;_USRDLL;CUSTOMACTIONTEST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<LanguageStandard>stdcpplatest</LanguageStandard>
@@ -95,11 +93,16 @@
<UACExecutionLevel>HighestAvailable</UACExecutionLevel>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(CIBuild)'!='true'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="CustomAction.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Version>0.18.0</Version>
<Version>0.19.0</Version>
<DefineConstants>Version=$(Version);</DefineConstants>
</PropertyGroup>
</Project>

5
nuget.config Normal file
View File

@@ -0,0 +1,5 @@
<configuration>
<config>
<clear />
</config>
</configuration>

View File

@@ -2,3 +2,6 @@
# SA1201: Elements should appear in the correct order
dotnet_diagnostic.SA1201.severity = none
# CA1303: Do not pass literals as localized parameters
dotnet_diagnostic.CA1303.severity = suggestion

View File

@@ -5,4 +5,4 @@ The PowerToys are split into DLLs for each PowerToy module ([`modules`](/src/mod
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 [`common`](/src/common) contains code for a static libary with helper functions, used by both the runner and the PowerToys modules.
The [`common`](/src/common) contains code for a static library with helper functions, used by both the runner and the PowerToys modules.

View File

@@ -6,6 +6,7 @@
#include <common/common.h>
#include <common/updating/updating.h>
#include <common/updating/http_client.h>
#include <winrt/Windows.ApplicationModel.h>
#include <winrt/Windows.Storage.h>
@@ -56,18 +57,11 @@ std::optional<fs::path> copy_self_to_temp_dir()
return std::move(dst_path);
}
bool install_new_version_stage_1(const bool must_restart = false)
bool install_new_version_stage_1(const std::wstring_view installer_filename, const bool must_restart = false)
{
std::optional<fs::path> installer;
for (auto path : fs::directory_iterator{ updating::get_pending_updates_path() })
{
if (path.path().native().find(updating::installer_filename_pattern) != std::wstring::npos)
{
installer.emplace(std::move(path));
break;
}
}
if (!installer)
const fs::path installer{ updating::get_pending_updates_path() / installer_filename };
if (!fs::is_regular_file(installer))
{
return false;
}
@@ -84,7 +78,7 @@ bool install_new_version_stage_1(const bool must_restart = false)
std::wstring arguments{ UPDATE_NOW_LAUNCH_STAGE2_CMDARG };
arguments += L" \"";
arguments += installer->c_str();
arguments += installer.c_str();
arguments += L"\" \"";
arguments += get_module_folderpath();
arguments += L"\" ";
@@ -103,15 +97,35 @@ bool install_new_version_stage_1(const bool must_restart = false)
}
}
bool install_new_version_stage_2(std::wstring_view installer_path, std::wstring_view install_path, const bool launch_powertoys)
bool install_new_version_stage_2(std::wstring installer_path, std::wstring_view install_path, const bool launch_powertoys)
{
if (MsiInstallProductW(installer_path.data(), nullptr) != ERROR_SUCCESS)
std::transform(begin(installer_path), end(installer_path), begin(installer_path), ::towlower);
bool success = true;
if (installer_path.ends_with(L".msi"))
{
return false;
success = MsiInstallProductW(installer_path.data(), nullptr) == ERROR_SUCCESS;
}
else
{
// If it's not .msi, then it's our .exe installer
SHELLEXECUTEINFOW sei{ sizeof(sei) };
sei.fMask = { SEE_MASK_FLAG_NO_UI | SEE_MASK_NOASYNC };
sei.lpFile = installer_path.c_str();
sei.nShow = SW_SHOWNORMAL;
success = ShellExecuteExW(&sei) == TRUE;
}
std::error_code _;
fs::remove(installer_path, _);
if (!success)
{
return false;
}
if (launch_powertoys)
{
std::wstring new_pt_path{ install_path };
@@ -151,7 +165,8 @@ bool install_dotnet()
{
try
{
updating::try_download_file(dotnet_download_path, download_link).wait();
http::HttpClient client;
client.download(download_link, dotnet_download_path).wait();
download_success = true;
break;
}
@@ -186,7 +201,68 @@ int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
}
std::wstring_view action{ args[1] };
if (action == L"-install_dotnet")
if (action == L"-run-non-elevated")
{
int nextArg = 2;
std::wstring_view target;
std::wstring_view pidFile;
std::wstring params;
while (nextArg < nArgs)
{
if (std::wstring_view(args[nextArg]) == L"-target" && nextArg + 1 < nArgs)
{
target = args[nextArg + 1];
nextArg += 2;
}
else if (std::wstring_view(args[nextArg]) == L"-pidFile" && nextArg + 1 < nArgs)
{
pidFile = args[nextArg + 1];
nextArg += 2;
}
else
{
params = args[nextArg];
nextArg++;
}
}
HANDLE hMapFile = NULL;
PDWORD pidBuffer = NULL;
if (!pidFile.empty())
{
hMapFile = OpenFileMappingW(FILE_MAP_WRITE, FALSE, pidFile.data());
if (hMapFile)
{
pidBuffer = reinterpret_cast<PDWORD>(MapViewOfFile(hMapFile, FILE_MAP_ALL_ACCESS, 0, 0, sizeof(DWORD)));
if (pidBuffer)
{
*pidBuffer = 0;
}
}
}
run_same_elevation(target.data(), params, pidBuffer);
// cleanup
if (!pidFile.empty())
{
if (pidBuffer)
{
FlushViewOfFile(pidBuffer, sizeof(DWORD));
UnmapViewOfFile(pidBuffer);
}
if (hMapFile)
{
FlushFileBuffers(hMapFile);
CloseHandle(hMapFile);
}
}
}
else if (action == L"-install_dotnet")
{
if (dotnet_is_installed())
{
@@ -200,11 +276,13 @@ int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
}
else if (action == UPDATE_NOW_LAUNCH_STAGE1_CMDARG)
{
return !install_new_version_stage_1();
std::wstring_view installerFilename{ args[2] };
return !install_new_version_stage_1(installerFilename);
}
else if (action == UPDATE_NOW_LAUNCH_STAGE1_START_PT_CMDARG)
{
return !install_new_version_stage_1(true);
std::wstring_view installerFilename{ args[2] };
return !install_new_version_stage_1(installerFilename, true);
}
else if (action == UPDATE_NOW_LAUNCH_STAGE2_CMDARG)
{
@@ -213,4 +291,4 @@ int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
}
return 0;
}
}

View File

@@ -1,5 +1,4 @@
// Microsoft Visual C++ generated resource script.
//
#include <windows.h>
#include "resource.h"
#include "../common/version.h"
@@ -10,34 +9,34 @@ BEGIN
END
1 VERSIONINFO
FILEVERSION FILE_VERSION
PRODUCTVERSION PRODUCT_VERSION
FILEFLAGSMASK 0x3fL
FILEVERSION FILE_VERSION
PRODUCTVERSION PRODUCT_VERSION
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
FILEFLAGS 0x1L
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BLOCK "040904b0" // US English (0x0409), Unicode (0x04B0) charset
BEGIN
VALUE "CompanyName", COMPANY_NAME
VALUE "FileDescription", "PowerToys Action Runner"
VALUE "FileDescription", FILE_DESCRIPTION
VALUE "FileVersion", FILE_VERSION_STRING
VALUE "InternalName", "PowerToys Action Runner"
VALUE "InternalName", INTERNAL_NAME
VALUE "LegalCopyright", COPYRIGHT_NOTE
VALUE "OriginalFilename", "action_runner.exe"
VALUE "ProductName", "PowerToys"
VALUE "OriginalFilename", ORIGINAL_FILENAME
VALUE "ProductName", PRODUCT_NAME
VALUE "ProductVersion", PRODUCT_VERSION_STRING
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
VALUE "Translation", 0x409, 1200 // US English (0x0409), Unicode (1200) charset
END
END

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props')" />
<Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props')" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@@ -165,20 +165,20 @@
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<ResourceCompile Include="action_runner.rc" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="action_runner.rc" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets')" />
<Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets'))" />
</Target>
</Project>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Windows.CppWinRT" version="2.0.200316.3" targetFramework="native" />
<package id="Microsoft.Windows.CppWinRT" version="2.0.200514.2" targetFramework="native" />
</packages>

View File

@@ -1,3 +1,16 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by action_runner.rc
//////////////////////////////
// Non-localizable
#define FILE_DESCRIPTION "PowerToys ActionRunner"
#define INTERNAL_NAME "action_runner"
#define ORIGINAL_FILENAME "action_runner.exe"
// Non-localizable
//////////////////////////////
#define IDS_DOTNET_CORE_DOWNLOAD_FAILURE 101
#define IDS_DOTNET_CORE_DOWNLOAD_FAILURE_TITLE 102

View File

@@ -0,0 +1,39 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\installer\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>
</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="2.9.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ManagedTelemetry\Telemetry\Telemetry.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,14 @@
using System;
using System.Runtime.InteropServices;
namespace ManagedCommon
{
internal static class NativeMethods
{
[DllImport("kernel32.dll", SetLastError = true)]
internal static extern IntPtr OpenProcess(uint processAccess, bool bInheritHandle, int processId);
[DllImport("kernel32.dll", SetLastError = true)]
internal static extern uint WaitForSingleObject(IntPtr hHandle, uint dwMilliseconds);
}
}

View File

@@ -0,0 +1,35 @@
using Microsoft.PowerToys.Telemetry;
using Microsoft.PowerToys.Telemetry.Events;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace ManagedCommon
{
public static class RunnerHelper
{
public static void WaitForPowerToysRunner(int powerToysPID, Action act)
{
var stackTrace = new StackTrace();
var assembly = Assembly.GetCallingAssembly().GetName();
var callingMethod = stackTrace.GetFrame(1).GetMethod().Name;
PowerToysTelemetry.Log.WriteEvent(new DebugEvent() { Message = $"[{assembly}][{callingMethod}]WaitForPowerToysRunner waiting for Event powerToysPID={powerToysPID}" });
Task.Run(() =>
{
const uint INFINITE = 0xFFFFFFFF;
const uint WAIT_OBJECT_0 = 0x00000000;
const uint SYNCHRONIZE = 0x00100000;
IntPtr powerToysProcHandle = NativeMethods.OpenProcess(SYNCHRONIZE, false, powerToysPID);
if (NativeMethods.WaitForSingleObject(powerToysProcHandle, INFINITE) == WAIT_OBJECT_0)
{
PowerToysTelemetry.Log.WriteEvent(new DebugEvent() { Message = $"[{assembly}][{callingMethod}]WaitForPowerToysRunner Event Notified powerToysPID={powerToysPID}" });
act.Invoke();
}
});
}
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.Tracing;
using System.Text;
namespace Microsoft.PowerToys.Telemetry.Events
{
[EventData]
public class DebugEvent : EventBase, IEvent
{
public string Message { get; set; }
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServicePerformance;
}
}

View File

@@ -1,9 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\installer\Version.props" />
<PropertyGroup>
<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>
</PropertyGroup>
<ItemGroup>

View File

@@ -0,0 +1,64 @@
#include "pch.h"
#include "RestartManagement.h"
#include <RestartManager.h>
#include <Psapi.h>
std::vector<RM_UNIQUE_PROCESS> GetProcessInfoByName(const std::wstring& processName)
{
DWORD bytesReturned{};
std::vector<DWORD> processIds{};
processIds.resize(1024);
DWORD processIdSize{ (DWORD)processIds.size() * sizeof(DWORD) };
EnumProcesses(processIds.data(), processIdSize, &bytesReturned);
while (bytesReturned == processIdSize)
{
processIdSize *= 2;
processIds.resize(processIdSize / sizeof(DWORD));
EnumProcesses(processIds.data(), processIdSize, &bytesReturned);
}
std::vector<RM_UNIQUE_PROCESS> pInfos{};
for (const DWORD& processId : processIds)
{
HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processId);
if (hProcess)
{
wchar_t name[MAX_PATH];
if (GetProcessImageFileName(hProcess, name, MAX_PATH) > 0)
{
if (processName == PathFindFileName(name))
{
FILETIME creationTime{};
FILETIME exitTime{};
FILETIME kernelTime{};
FILETIME userTime{};
if (GetProcessTimes(hProcess, &creationTime, &exitTime, &kernelTime, &userTime))
{
pInfos.push_back({ processId, creationTime });
}
}
}
CloseHandle(hProcess);
}
}
return pInfos;
}
void RestartProcess(const std::wstring& processName)
{
DWORD sessionHandle{};
WCHAR sessionKey[CCH_RM_SESSION_KEY + 1];
if (RmStartSession(&sessionHandle, 0, sessionKey) != ERROR_SUCCESS)
{
return;
}
std::vector<RM_UNIQUE_PROCESS> pInfo = GetProcessInfoByName(processName);
if (pInfo.empty() ||
RmRegisterResources(sessionHandle, 0, nullptr, sizeof(pInfo), pInfo.data(), 0, nullptr) != ERROR_SUCCESS)
{
return;
}
RmShutdown(sessionHandle, RmForceShutdown, nullptr);
RmRestart(sessionHandle, 0, nullptr);
RmEndSession(sessionHandle);
}

View File

@@ -0,0 +1,5 @@
#pragma once
#include <string>
void RestartProcess(const std::wstring& processName);

View File

@@ -364,7 +364,7 @@ namespace UnitTestsCommonLib
const auto value = true;
Settings settings(nullptr, m_moduleName);
settings.add_bool_toogle(m_defaultSettingsName, m_defaultSettingsDescription, value);
settings.add_bool_toggle(m_defaultSettingsName, m_defaultSettingsDescription, value);
auto expected = m_defaultSettingsJson;
auto expectedProperties = createSettingsProperties(L"bool_toggle");
@@ -381,7 +381,7 @@ namespace UnitTestsCommonLib
const auto value = false;
Settings settings(nullptr, m_moduleName);
settings.add_bool_toogle(m_defaultSettingsName, m_defaultSettingsDescription, value);
settings.add_bool_toggle(m_defaultSettingsName, m_defaultSettingsDescription, value);
auto expected = m_defaultSettingsJson;
auto expectedProperties = createSettingsProperties(L"bool_toggle");

View File

@@ -0,0 +1,36 @@
#include <windows.h>
#include "resource.h"
#include "../version.h"
1 VERSIONINFO
FILEVERSION FILE_VERSION
PRODUCTVERSION PRODUCT_VERSION
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0" // US English (0x0409), Unicode (0x04B0) charset
BEGIN
VALUE "CompanyName", COMPANY_NAME
VALUE "FileDescription", FILE_DESCRIPTION
VALUE "FileVersion", FILE_VERSION_STRING
VALUE "InternalName", INTERNAL_NAME
VALUE "LegalCopyright", COPYRIGHT_NOTE
VALUE "OriginalFilename", ORIGINAL_FILENAME
VALUE "ProductName", PRODUCT_NAME
VALUE "ProductVersion", PRODUCT_VERSION_STRING
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200 // US English (0x0409), Unicode (1200) charset
END
END

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props')" />
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props')" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
@@ -59,7 +59,6 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
@@ -68,7 +67,6 @@
<AdditionalIncludeDirectories>..\;..\Telemetry;..\..\..\deps\cpprestsdk\include;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<UseFullPaths>true</UseFullPaths>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
@@ -82,14 +80,12 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;..\;..\..\..\deps\cpprestsdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<UseFullPaths>true</UseFullPaths>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
@@ -99,17 +95,23 @@
<AdditionalDependencies>RuntimeObject.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(CIBuild)'!='true'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="UnitTestsCommon.cpp" />
<ClCompile Include="UnitTestsVersionHelper.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="Settings.Tests.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\common.vcxproj">
@@ -119,15 +121,18 @@
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="UnitTests-CommonLib.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets')" />
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets'))" />
</Target>
</Project>

View File

@@ -32,8 +32,16 @@
<ClInclude Include="pch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="resource.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="UnitTests-CommonLib.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

View File

@@ -13,7 +13,7 @@ namespace UnitTestsVersionHelper
TEST_CLASS (UnitTestsVersionHelper)
{
public:
TEST_METHOD (integerConstructorShouldProprelyInitializateVersionNumbers)
TEST_METHOD (integerConstructorShouldProperlyInitializationVersionNumbers)
{
VersionHelper sut(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
@@ -21,7 +21,7 @@ namespace UnitTestsVersionHelper
Assert::AreEqual(MINOR_VERSION_12, sut.minor);
Assert::AreEqual(REVISION_VERSION_0, sut.revision);
}
TEST_METHOD (integerConstructorShouldProprelyInitializateWithDifferentVersionNumbers)
TEST_METHOD (integerConstructorShouldProperlyInitializationWithDifferentVersionNumbers)
{
const int testcaseMajor = 2;
const int testcaseMinor = 25;
@@ -32,7 +32,7 @@ namespace UnitTestsVersionHelper
Assert::AreEqual(testcaseMinor, sut.minor);
Assert::AreEqual(testcaseRevision, sut.revision);
}
TEST_METHOD (stringConstructorShouldProprelyInitializateVersionNumbers)
TEST_METHOD (stringConstructorShouldProperlyInitializationVersionNumbers)
{
VersionHelper sut("v0.12.3");
@@ -40,7 +40,7 @@ namespace UnitTestsVersionHelper
Assert::AreEqual(12, sut.minor);
Assert::AreEqual(3, sut.revision);
}
TEST_METHOD (stringConstructorShouldProprelyInitializateWithDifferentVersionNumbers)
TEST_METHOD (stringConstructorShouldProperlyInitializationWithDifferentVersionNumbers)
{
VersionHelper sut("v2.25.1");
@@ -48,28 +48,28 @@ namespace UnitTestsVersionHelper
Assert::AreEqual(25, sut.minor);
Assert::AreEqual(1, sut.revision);
}
TEST_METHOD (whenMajorVersionIsGreaterComparationOperatorShouldReturnProperValue)
TEST_METHOD (whenMajorVersionIsGreaterComparisonOperatorShouldReturnProperValue)
{
VersionHelper lhs(MAJOR_VERSION_0 + 1, MINOR_VERSION_12, REVISION_VERSION_0);
VersionHelper rhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
Assert::IsTrue(lhs > rhs);
}
TEST_METHOD (whenMajorVersionIsLesserComparationOperatorShouldReturnProperValue)
TEST_METHOD (whenMajorVersionIsLesserComparisonOperatorShouldReturnProperValue)
{
VersionHelper lhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
VersionHelper rhs(MAJOR_VERSION_0 + 1, MINOR_VERSION_12, REVISION_VERSION_0);
Assert::IsFalse(lhs > rhs);
}
TEST_METHOD (whenMajorVersionIsEqualComparationOperatorShouldCompareMinorVersionValue)
TEST_METHOD (whenMajorVersionIsEqualComparisonOperatorShouldCompareMinorVersionValue)
{
VersionHelper lhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
VersionHelper rhs(MAJOR_VERSION_0, MINOR_VERSION_12 - 1, REVISION_VERSION_0);
Assert::IsTrue(lhs > rhs);
}
TEST_METHOD (whenMajorVersionIsEqualComparationOperatorShouldCompareMinorVersionValue2)
TEST_METHOD (whenMajorVersionIsEqualComparisonOperatorShouldCompareMinorVersionValue2)
{
VersionHelper lhs(MAJOR_VERSION_0, MINOR_VERSION_12 - 1, REVISION_VERSION_0);
VersionHelper rhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
@@ -77,14 +77,14 @@ namespace UnitTestsVersionHelper
Assert::IsFalse(lhs > rhs);
}
TEST_METHOD (whenMajorAndMinorVersionIsEqualComparationOperatorShouldCompareRevisionValue)
TEST_METHOD (whenMajorAndMinorVersionIsEqualComparisonOperatorShouldCompareRevisionValue)
{
VersionHelper lhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0 + 1);
VersionHelper rhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
Assert::IsTrue(lhs > rhs);
}
TEST_METHOD (whenMajorAndMinorVersionIsEqualComparationOperatorShouldCompareRevisionValue2)
TEST_METHOD (whenMajorAndMinorVersionIsEqualComparisonOperatorShouldCompareRevisionValue2)
{
VersionHelper lhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
VersionHelper rhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0 + 1);

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Windows.CppWinRT" version="2.0.200316.3" targetFramework="native" />
<package id="Microsoft.Windows.CppWinRT" version="2.0.200514.2" targetFramework="native" />
</packages>

View File

@@ -0,0 +1,13 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by UnitTests-CommonLib.rc
//////////////////////////////
// Non-localizable
#define FILE_DESCRIPTION "PowerToys UnitTests-CommonLib"
#define INTERNAL_NAME "UnitTests-CommonLib"
#define ORIGINAL_FILENAME "UnitTests-CommonLib.dll"
// Non-localizable
//////////////////////////////

View File

@@ -3,12 +3,12 @@
/*
Usage:
When creating animation contstructor takes one parameter - how long
When creating animation constructor takes one parameter - how long
should the animation take in seconds.
Call reset() when starting animation.
When redering, call value() to get value from 0 to 1 - depending on animation
When rendering, call value() to get value from 0 to 1 - depending on animation
progress.
*/
class Animation

View File

@@ -15,7 +15,7 @@
<ProjectGuid>{985B3F2F-CEED-4C0A-A249-69257E719145}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>commonmdflag</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
@@ -53,16 +53,14 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<ConformanceMode>false</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<AdditionalIncludeDirectories>inc;telemetry;..\..\deps\cpprestsdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>inc;telemetry;../../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@@ -73,20 +71,24 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<ConformanceMode>false</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<AdditionalIncludeDirectories>inc;telemetry;..\..\deps\cpprestsdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>inc;telemetry;../../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(CIBuild)'!='true'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\common.h" />
<ClInclude Include="..\keyboard_layout.h" />
@@ -98,7 +100,9 @@
<ItemGroup>
<ClCompile Include="..\common.cpp" />
<ClCompile Include="..\keyboard_layout.cpp" />
<ClCompile Include="..\pch.cpp" />
<ClCompile Include="..\pch.cpp">
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\two_way_pipe_message_ipc.cpp" />
</ItemGroup>
<ItemGroup>
@@ -106,12 +110,12 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.191107.2\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.191107.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
<Import Project="..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200519.2\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200519.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.191107.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.191107.2\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200519.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200519.2\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
</Target>
</Project>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.191107.2" targetFramework="native" />
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.200519.2" targetFramework="native" />
</packages>

View File

@@ -171,17 +171,17 @@ ShortcutGuideFilter get_shortcutguide_filtered_window()
{
return result;
}
static HWND cortanda_hwnd = nullptr;
if (cortanda_hwnd == nullptr)
static HWND cortana_hwnd = nullptr;
if (cortana_hwnd == nullptr)
{
if (strcmp(class_name.data(), "Windows.UI.Core.CoreWindow") == 0 &&
get_process_path(active_window).ends_with(L"SearchUI.exe"))
{
cortanda_hwnd = active_window;
cortana_hwnd = active_window;
return result;
}
}
else if (cortanda_hwnd == active_window)
else if (cortana_hwnd == active_window)
{
return result;
}
@@ -191,7 +191,7 @@ ShortcutGuideFilter get_shortcutguide_filtered_window()
// WinKey + Up just won't maximize the window. Similary, without
// WS_MINIMIZEBOX the window will not get minimized. A "Save As..." dialog
// is a example of such window - it can be snapped to both sides and to
// all screen conrers, but will not get maximized nor minimized.
// all screen corners, but will not get maximized nor minimized.
// For now, since ShortcutGuide can only disable entire "Windows Controls"
// group, we require that the window supports all the options.
result.snappable = ((style & WS_MAXIMIZEBOX) == WS_MAXIMIZEBOX) &&
@@ -321,7 +321,7 @@ WindowState get_window_state(HWND hwnd)
if (GetWindowPlacement(hwnd, &placement) == 0)
{
return UNKNONW;
return UNKNOWN;
}
if (placement.showCmd == SW_MINIMIZE || placement.showCmd == SW_SHOWMINIMIZED || IsIconic(hwnd))
@@ -337,7 +337,7 @@ WindowState get_window_state(HWND hwnd)
auto rectp = get_window_pos(hwnd);
if (!rectp)
{
return UNKNONW;
return UNKNOWN;
}
auto rect = *rectp;
@@ -461,7 +461,7 @@ bool run_elevated(const std::wstring& file, const std::wstring& params)
}
}
bool run_non_elevated(const std::wstring& file, const std::wstring& params)
bool run_non_elevated(const std::wstring& file, const std::wstring& params, DWORD* returnPid)
{
auto executable_args = L"\"" + file + L"\"";
if (!params.empty())
@@ -510,8 +510,8 @@ bool run_non_elevated(const std::wstring& file, const std::wstring& params)
siex.lpAttributeList = pptal;
siex.StartupInfo.cb = sizeof(siex);
PROCESS_INFORMATION process_info = { 0 };
auto succedded = CreateProcessW(file.c_str(),
PROCESS_INFORMATION pi = { 0 };
auto succeeded = CreateProcessW(file.c_str(),
const_cast<LPWSTR>(executable_args.c_str()),
nullptr,
nullptr,
@@ -520,28 +520,38 @@ bool run_non_elevated(const std::wstring& file, const std::wstring& params)
nullptr,
nullptr,
&siex.StartupInfo,
&process_info);
if (process_info.hProcess)
&pi);
if (succeeded)
{
CloseHandle(process_info.hProcess);
if (pi.hProcess)
{
if (returnPid)
{
*returnPid = GetProcessId(pi.hProcess);
}
CloseHandle(pi.hProcess);
}
if (pi.hThread)
{
CloseHandle(pi.hThread);
}
}
if (process_info.hThread)
{
CloseHandle(process_info.hThread);
}
return succedded;
return succeeded;
}
bool run_same_elevation(const std::wstring& file, const std::wstring& params)
bool run_same_elevation(const std::wstring& file, const std::wstring& params, DWORD* returnPid)
{
auto executable_args = L"\"" + file + L"\"";
if (!params.empty())
{
executable_args += L" " + params;
}
STARTUPINFO si = { 0 };
PROCESS_INFORMATION pi = { 0 };
auto succedded = CreateProcessW(file.c_str(),
auto succeeded = CreateProcessW(file.c_str(),
const_cast<LPWSTR>(executable_args.c_str()),
nullptr,
nullptr,
@@ -551,15 +561,25 @@ bool run_same_elevation(const std::wstring& file, const std::wstring& params)
nullptr,
&si,
&pi);
if (pi.hProcess)
if (succeeded)
{
CloseHandle(pi.hProcess);
if (pi.hProcess)
{
if (returnPid)
{
*returnPid = GetProcessId(pi.hProcess);
}
CloseHandle(pi.hProcess);
}
if (pi.hThread)
{
CloseHandle(pi.hThread);
}
}
if (pi.hThread)
{
CloseHandle(pi.hThread);
}
return succedded;
return succeeded;
}
std::wstring get_process_path(HWND window) noexcept
@@ -571,7 +591,7 @@ std::wstring get_process_path(HWND window) noexcept
if (name.length() >= app_frame_host.length() &&
name.compare(name.length() - app_frame_host.length(), app_frame_host.length(), app_frame_host) == 0)
{
// It is a UWP app. We will enumarate the windows and look for one created
// It is a UWP app. We will enumerate the windows and look for one created
// by something with a different PID
DWORD new_pid = pid;
EnumChildWindows(

View File

@@ -6,12 +6,12 @@
#include <memory>
#include <vector>
// Returns RECT with positions of the minmize/maximize buttons of the given window.
// Returns RECT with positions of the minimize/maximize buttons of the given window.
// Does not always work, since some apps draw custom toolbars.
std::optional<RECT> get_button_pos(HWND hwnd);
// Gets position of given window.
std::optional<RECT> get_window_pos(HWND hwnd);
// Gets mouse postion.
// Gets mouse position.
std::optional<POINT> get_mouse_pos();
// Test if window can be zoned by FancyZones
@@ -47,7 +47,7 @@ void show_last_error_message(LPCWSTR lpszFunction, DWORD dw);
enum WindowState
{
UNKNONW,
UNKNOWN,
MINIMIZED,
MAXIMIZED,
SNAPED_TOP_LEFT,
@@ -63,17 +63,17 @@ WindowState get_window_state(HWND hwnd);
// Returns true if the current process is running with elevated privileges
bool is_process_elevated(const bool use_cached_value = true);
// Drops the elevated privilages if present
// Drops the elevated privileges if present
bool drop_elevated_privileges();
// Run command as elevated user, returns true if succeeded
bool run_elevated(const std::wstring& file, const std::wstring& params);
// Run command as non-elevated user, returns true if succeeded
bool run_non_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
bool run_non_elevated(const std::wstring& file, const std::wstring& params, DWORD* returnPid);
// Run command with the same elevation, returns true if succedded
bool run_same_elevation(const std::wstring& file, const std::wstring& params);
// Run command with the same elevation, returns true if succeeded
bool run_same_elevation(const std::wstring& file, const std::wstring& params, DWORD* returnPid);
// Returns true if the current process is running from administrator account
bool check_user_is_admin();
@@ -136,3 +136,5 @@ struct overloaded : Ts...
};
template<class... Ts>
overloaded(Ts...)->overloaded<Ts...>;
#define POWER_LAUNCHER_PID_SHARED_FILE L"Local\\3cbfbad4-199b-4e2c-9825-942d5d3d3c74"

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props')" />
<Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props')" />
<Import Project="..\..\installer\Version.props" />
<Target Name="GenerateVersionData" BeforeTargets="PrepareForBuild">
<ItemGroup>
@@ -68,12 +68,10 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpplatest</LanguageStandard>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalIncludeDirectories>inc;telemetry;..\..\deps\cpprestsdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@@ -84,12 +82,17 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<Lib>
<AdditionalLibraryDirectories>Shlwapi.lib;</AdditionalLibraryDirectories>
<AdditionalDependencies>shlwapi.lib;shcore.lib</AdditionalDependencies>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(CIBuild)'!='true'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
@@ -97,7 +100,6 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpplatest</LanguageStandard>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalIncludeDirectories>inc;telemetry;..\..\deps\cpprestsdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/await %(AdditionalOptions)</AdditionalOptions>
@@ -109,7 +111,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<Lib>
<AdditionalLibraryDirectories>Shlwapi.lib;</AdditionalLibraryDirectories>
<AdditionalDependencies>shlwapi.lib;shcore.lib</AdditionalDependencies>
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
@@ -118,11 +120,14 @@
<ClInclude Include="d2d_svg.h" />
<ClInclude Include="d2d_text.h" />
<ClInclude Include="d2d_window.h" />
<ClInclude Include="debug_control.h" />
<ClInclude Include="dpi_aware.h" />
<ClInclude Include="com_object_factory.h" />
<ClInclude Include="keyboard_layout.h" />
<ClInclude Include="keyboard_layout_impl.h" />
<ClInclude Include="notifications.h" />
<ClInclude Include="os-detection\os-detect.h" />
<ClInclude Include="RestartManagement.h" />
<ClInclude Include="shared_constants.h" />
<ClInclude Include="timeutil.h" />
<ClInclude Include="two_way_pipe_message_ipc.h" />
@@ -156,10 +161,11 @@
<ClCompile Include="monitors.cpp" />
<ClCompile Include="notifications.cpp" />
<ClCompile Include="on_thread_executor.cpp" />
<ClCompile Include="os-detection\os-detect.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="RestartManagement.cpp" />
<ClCompile Include="settings_helpers.cpp" />
<ClCompile Include="settings_objects.cpp" />
<ClCompile Include="icon_helpers.cpp" />
@@ -178,15 +184,15 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.191107.2\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.191107.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
<Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets')" />
<Import Project="..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200519.2\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200519.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
<Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.191107.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.191107.2\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200519.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200519.2\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets'))" />
</Target>
</Project>

View File

@@ -111,6 +111,15 @@
<ClInclude Include="two_way_pipe_message_ipc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="os-detection\os-detect.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="RestartManagement.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="debug_control.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="d2d_svg.cpp">
@@ -180,6 +189,12 @@
<ClCompile Include="two_way_pipe_message_ipc.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="os-detection\os-detect.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="RestartManagement.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />

View File

@@ -24,19 +24,19 @@ D2DText& D2DText::resize(float text_size, float scale)
return *this;
}
D2DText& D2DText::set_aligment_left()
D2DText& D2DText::set_alignment_left()
{
winrt::check_hresult(format->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING));
return *this;
}
D2DText& D2DText::set_aligment_center()
D2DText& D2DText::set_alignment_center()
{
winrt::check_hresult(format->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_CENTER));
return *this;
}
D2DText& D2DText::set_aligment_right()
D2DText& D2DText::set_alignment_right()
{
winrt::check_hresult(format->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_TRAILING));
return *this;

View File

@@ -7,9 +7,9 @@ class D2DText
public:
D2DText(float text_size = 15.0f, float scale = 1.0f);
D2DText& resize(float text_size, float scale);
D2DText& set_aligment_left();
D2DText& set_aligment_center();
D2DText& set_aligment_right();
D2DText& set_alignment_left();
D2DText& set_alignment_center();
D2DText& set_alignment_right();
void write(ID2D1DeviceContext5* d2d_dc, D2D1_COLOR_F color, D2D1_RECT_F rect, std::wstring text);
private:

View File

@@ -69,7 +69,7 @@ void D2DWindow::base_init()
&options,
d2d_factory.put_void()));
}
// For all other stuff - assing nullptr first to release the object, to reset the com_ptr.
// For all other stuff - assign nullptr first to release the object, to reset the com_ptr.
d2d_dc = nullptr;
d2d_device = nullptr;
dxgi_factory = nullptr;

View File

@@ -0,0 +1,4 @@
#pragma once
// Prevent system-wide input lagging while paused in the debugger
//#define DISABLE_LOWLEVEL_HOOKS_WHEN_DEBUGGED

View File

@@ -56,7 +56,7 @@ namespace DPIAware
SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
}
AwarnessLevel GetAwarenessLevel(DPI_AWARENESS_CONTEXT system_returned_value)
AwarenessLevel GetAwarenessLevel(DPI_AWARENESS_CONTEXT system_returned_value)
{
const std::array levels{ DPI_AWARENESS_CONTEXT_UNAWARE,
DPI_AWARENESS_CONTEXT_SYSTEM_AWARE,
@@ -67,9 +67,9 @@ namespace DPIAware
{
if (AreDpiAwarenessContextsEqual(levels[i], system_returned_value))
{
return static_cast<AwarnessLevel>(i);
return static_cast<AwarenessLevel>(i);
}
}
return AwarnessLevel::UNAWARE;
return AwarenessLevel::UNAWARE;
}
}

View File

@@ -10,7 +10,7 @@ namespace DPIAware
void Convert(HMONITOR monitor_handle, int& width, int& height);
void EnableDPIAwarenessForThisProcess();
enum AwarnessLevel
enum AwarenessLevel
{
UNAWARE,
SYSTEM_AWARE,
@@ -18,5 +18,5 @@ namespace DPIAware
PER_MONITOR_AWARE_V2,
UNAWARE_GDISCALED
};
AwarnessLevel GetAwarenessLevel(DPI_AWARENESS_CONTEXT system_returned_value);
AwarenessLevel GetAwarenessLevel(DPI_AWARENESS_CONTEXT system_returned_value);
};

View File

@@ -1,20 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("interop-tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("interop-tests")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("437ad818-3f1f-4ca5-a79b-25233a157026")]
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -2,6 +2,39 @@
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\..\packages\MSTest.TestAdapter.2.1.0\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\..\..\packages\MSTest.TestAdapter.2.1.0\build\net45\MSTest.TestAdapter.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="..\..\..\installer\Version.props" />
<!-- We don't have GenerateAssemblyInfo task until we use .net core, so we generate it with WriteLinesToFile -->
<PropertyGroup>
<AssemblyTitle>interop-tests</AssemblyTitle>
<AssemblyCompany>Microsoft Corp.</AssemblyCompany>
<AssemblyCopyright>Copyright (C) 2020 Microsoft Corp.</AssemblyCopyright>
</PropertyGroup>
<ItemGroup>
<AssemblyVersionFiles Include="Generated Files\AssemblyInfo.cs" />
</ItemGroup>
<Target Name="GenerateAssemblyInfo" BeforeTargets="PrepareForBuild">
<ItemGroup>
<HeaderLines Include="// Copyright (c) Microsoft Corporation" />
<HeaderLines Include="// The Microsoft Corporation licenses this file to you under the MIT license." />
<HeaderLines Include="// See the LICENSE file in the project root for more information." />
<HeaderLines Include="#pragma warning disable SA1516" />
<HeaderLines Include="using System.Reflection%3b" />
<HeaderLines Include="using System.Runtime.InteropServices%3b" />
<HeaderLines Include="using System.Windows%3b" />
<HeaderLines Include="[assembly: AssemblyTitle(&quot;$(AssemblyTitle)&quot;)]" />
<HeaderLines Include="[assembly: AssemblyDescription(&quot;&quot;)]" />
<HeaderLines Include="[assembly: AssemblyConfiguration(&quot;&quot;)]" />
<HeaderLines Include="[assembly: AssemblyCompany(&quot;$(AssemblyCompany)&quot;)]" />
<HeaderLines Include="[assembly: AssemblyCopyright(&quot;$(AssemblyCopyright)&quot;)]" />
<HeaderLines Include="[assembly: AssemblyProduct(&quot;$(AssemblyTitle)&quot;)]" />
<HeaderLines Include="[assembly: AssemblyTrademark(&quot;&quot;)]" />
<HeaderLines Include="[assembly: AssemblyCulture(&quot;&quot;)]" />
<HeaderLines Include="[assembly: ComVisible(false)]" />
<HeaderLines Include="[assembly: AssemblyVersion(&quot;$(Version).0&quot;)]" />
<HeaderLines Include="[assembly: AssemblyFileVersion(&quot;$(Version).0&quot;)]" />
</ItemGroup>
<WriteLinesToFile File="Generated Files\AssemblyInfo.cs" Lines="@(HeaderLines)" Overwrite="true" Encoding="Unicode" WriteOnlyWhenDifferent="true" />
</Target>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -53,7 +86,9 @@
</ItemGroup>
<ItemGroup>
<Compile Include="UnitTest1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Generated Files\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />

View File

@@ -0,0 +1,133 @@
#include "pch.h"
#include "HotkeyManager.h"
using namespace interop;
HotkeyManager::HotkeyManager()
{
keyboardEventCallback = gcnew KeyboardEventCallback(this, &HotkeyManager::KeyboardEventProc);
isActiveCallback = gcnew IsActiveCallback(this, &HotkeyManager::IsActiveProc);
filterKeyboardCallback = gcnew FilterKeyboardEvent(this, &HotkeyManager::FilterKeyboardProc);
keyboardHook = gcnew KeyboardHook(
keyboardEventCallback,
isActiveCallback,
filterKeyboardCallback
);
hotkeys = gcnew Dictionary<HOTKEY_HANDLE, HotkeyCallback ^>();
pressedKeys = gcnew Hotkey();
keyboardHook->Start();
}
HotkeyManager::~HotkeyManager()
{
delete keyboardHook;
}
// When all Shortcut keys are pressed, fire the HotkeyCallback event.
void HotkeyManager::KeyboardEventProc(KeyboardEvent^ ev)
{
auto pressedKeysHandle = GetHotkeyHandle(pressedKeys);
if (hotkeys->ContainsKey(pressedKeysHandle))
{
hotkeys[pressedKeysHandle]->Invoke();
}
}
// Hotkeys are intended to be global, therefore they are always active no matter the
// context in which the keypress occurs.
bool HotkeyManager::IsActiveProc()
{
return true;
}
// KeyboardEvent callback is only fired for relevant key events.
bool HotkeyManager::FilterKeyboardProc(KeyboardEvent^ ev)
{
auto oldHandle = GetHotkeyHandle(pressedKeys);
// Updating the pressed keys here so we know if the keypress event
// should be propagated or not.
UpdatePressedKeys(ev);
auto pressedKeysHandle = GetHotkeyHandle(pressedKeys);
// Check if the hotkey matches the pressed keys, and check if the pressed keys aren't duplicate
// (there shouldn't be auto repeating hotkeys)
if (hotkeys->ContainsKey(pressedKeysHandle) && oldHandle != pressedKeysHandle)
{
return true;
}
return false;
}
// NOTE: Replaces old hotkey if one already present.
HOTKEY_HANDLE HotkeyManager::RegisterHotkey(Hotkey ^ hotkey, HotkeyCallback ^ callback)
{
auto handle = GetHotkeyHandle(hotkey);
hotkeys[handle] = callback;
return handle;
}
void HotkeyManager::UnregisterHotkey(HOTKEY_HANDLE handle)
{
hotkeys->Remove(handle);
}
HOTKEY_HANDLE HotkeyManager::GetHotkeyHandle(Hotkey ^ hotkey)
{
HOTKEY_HANDLE handle = hotkey->Key;
handle |= hotkey->Win << 8;
handle |= hotkey->Ctrl << 9;
handle |= hotkey->Shift << 10;
handle |= hotkey->Alt << 11;
return handle;
}
void HotkeyManager::UpdatePressedKey(DWORD code, bool replaceWith, unsigned char replaceWithKey)
{
switch (code)
{
case VK_LWIN:
case VK_RWIN:
pressedKeys->Win = replaceWith;
break;
case VK_CONTROL:
case VK_LCONTROL:
case VK_RCONTROL:
pressedKeys->Ctrl = replaceWith;
break;
case VK_SHIFT:
case VK_LSHIFT:
case VK_RSHIFT:
pressedKeys->Shift = replaceWith;
break;
case VK_MENU:
case VK_LMENU:
case VK_RMENU:
pressedKeys->Alt = replaceWith;
break;
default:
pressedKeys->Key = replaceWithKey;
break;
}
}
void HotkeyManager::UpdatePressedKeys(KeyboardEvent ^ ev)
{
switch (ev->message)
{
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
{
UpdatePressedKey(ev->key, true, ev->key);
}
break;
case WM_KEYUP:
case WM_SYSKEYUP:
{
UpdatePressedKey(ev->key, false, 0);
}
break;
}
}

View File

@@ -0,0 +1,57 @@
#pragma once
#include <Windows.h>
#include "KeyboardHook.h"
namespace interop
{
public
ref struct Hotkey
{
bool Win;
bool Ctrl;
bool Shift;
bool Alt;
unsigned char Key;
Hotkey()
{
Win = false;
Ctrl = false;
Shift = false;
Alt = false;
Key = 0;
}
};
public
delegate void HotkeyCallback();
typedef unsigned short HOTKEY_HANDLE;
public
ref class HotkeyManager
{
public:
HotkeyManager();
~HotkeyManager();
HOTKEY_HANDLE RegisterHotkey(Hotkey ^ hotkey, HotkeyCallback ^ callback);
void UnregisterHotkey(HOTKEY_HANDLE handle);
private:
KeyboardHook ^ keyboardHook;
Dictionary<HOTKEY_HANDLE, HotkeyCallback ^> ^ hotkeys;
Hotkey ^ pressedKeys;
KeyboardEventCallback ^ keyboardEventCallback;
IsActiveCallback ^ isActiveCallback;
FilterKeyboardEvent ^ filterKeyboardCallback;
void KeyboardEventProc(KeyboardEvent ^ ev);
bool IsActiveProc();
bool FilterKeyboardProc(KeyboardEvent ^ ev);
HOTKEY_HANDLE GetHotkeyHandle(Hotkey ^ hotkey);
void UpdatePressedKeys(KeyboardEvent ^ ev);
void UpdatePressedKey(DWORD code, bool replaceWith, unsigned char replaceWithKey);
};
}

View File

@@ -0,0 +1,111 @@
#include "pch.h"
#include "KeyboardHook.h"
#include <exception>
#include <msclr\marshal.h>
#include <msclr\marshal_cppstd.h>
#include <common/debug_control.h>
using namespace interop;
using namespace System::Runtime::InteropServices;
using namespace System;
using namespace System::Diagnostics;
KeyboardHook::KeyboardHook(
KeyboardEventCallback ^ keyboardEventCallback,
IsActiveCallback ^ isActiveCallback,
FilterKeyboardEvent ^ filterKeyboardEvent)
{
kbEventDispatch = gcnew Thread(gcnew ThreadStart(this, &KeyboardHook::DispatchProc));
queue = gcnew Queue<KeyboardEvent ^>();
this->keyboardEventCallback = keyboardEventCallback;
this->isActiveCallback = isActiveCallback;
this->filterKeyboardEvent = filterKeyboardEvent;
}
KeyboardHook::~KeyboardHook()
{
quit = true;
// Notify the DispatchProc thread so that it isn't stuck at the Wait step
Monitor::Enter(queue);
Monitor::Pulse(queue);
Monitor::Exit(queue);
kbEventDispatch->Join();
// Unregister low level hook procedure
UnhookWindowsHookEx(hookHandle);
}
void KeyboardHook::DispatchProc()
{
Monitor::Enter(queue);
quit = false;
while (!quit)
{
if (queue->Count == 0)
{
Monitor::Wait(queue);
continue;
}
auto nextEv = queue->Dequeue();
// Release lock while callback is being invoked
Monitor::Exit(queue);
keyboardEventCallback->Invoke(nextEv);
// Re-aquire lock
Monitor::Enter(queue);
}
Monitor::Exit(queue);
}
void KeyboardHook::Start()
{
hookProc = gcnew HookProcDelegate(this, &KeyboardHook::HookProc);
Process ^ curProcess = Process::GetCurrentProcess();
ProcessModule ^ curModule = curProcess->MainModule;
#if defined(DISABLE_LOWLEVEL_HOOKS_WHEN_DEBUGGED)
const bool hookDisabled = IsDebuggerPresent();
#else
const bool hookDisabled = false;
#endif
if (!hookDisabled)
{
// register low level hook procedure
hookHandle = SetWindowsHookEx(
WH_KEYBOARD_LL,
(HOOKPROC)(void*)Marshal::GetFunctionPointerForDelegate(hookProc),
0,
0);
if (hookHandle == nullptr)
{
throw std::exception("SetWindowsHookEx failed.");
}
}
kbEventDispatch->Start();
}
LRESULT CALLBACK KeyboardHook::HookProc(int nCode, WPARAM wParam, LPARAM lParam)
{
if (nCode == HC_ACTION && isActiveCallback->Invoke())
{
KeyboardEvent ^ ev = gcnew KeyboardEvent();
ev->message = wParam;
ev->key = reinterpret_cast<KBDLLHOOKSTRUCT*>(lParam)->vkCode;
if (filterKeyboardEvent != nullptr && !filterKeyboardEvent->Invoke(ev))
{
return CallNextHookEx(hookHandle, nCode, wParam, lParam);
}
Monitor::Enter(queue);
queue->Enqueue(ev);
Monitor::Pulse(queue);
Monitor::Exit(queue);
return 1;
}
return CallNextHookEx(hookHandle, nCode, wParam, lParam);
}

View File

@@ -0,0 +1,49 @@
#pragma once
using namespace System::Threading;
using namespace System::Collections::Generic;
namespace interop
{
public
ref struct KeyboardEvent
{
WPARAM message;
int key;
};
public
delegate void KeyboardEventCallback(KeyboardEvent ^ ev);
public
delegate bool IsActiveCallback();
public
delegate bool FilterKeyboardEvent(KeyboardEvent ^ ev);
public
ref class KeyboardHook
{
public:
KeyboardHook(
KeyboardEventCallback ^ keyboardEventCallback,
IsActiveCallback ^ isActiveCallback,
FilterKeyboardEvent ^ filterKeyboardEvent);
~KeyboardHook();
void Start();
private:
delegate LRESULT HookProcDelegate(int nCode, WPARAM wParam, LPARAM lParam);
Thread ^ kbEventDispatch;
Queue<KeyboardEvent ^> ^ queue;
KeyboardEventCallback ^ keyboardEventCallback;
IsActiveCallback ^ isActiveCallback;
FilterKeyboardEvent ^ filterKeyboardEvent;
bool quit;
HHOOK hookHandle;
HookProcDelegate ^ hookProc;
void DispatchProc();
LRESULT CALLBACK HookProc(int nCode, WPARAM wParam, LPARAM lParam);
};
}

View File

@@ -1,3 +1,13 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by app.rc
// Used by interop.rc
//////////////////////////////
// Non-localizable
#define FILE_DESCRIPTION "PowerToys Interop"
#define INTERNAL_NAME "PowerToysInterop"
#define ORIGINAL_FILENAME "PowerToysInterop.dll"
// Non-localizable
//////////////////////////////

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\..\installer\Version.props" />
<PropertyGroup>
@@ -22,7 +22,7 @@
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<Keyword>ManagedCProj</Keyword>
<RootNamespace>interop</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
@@ -65,14 +65,12 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)src\common\interop;$(SolutionDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(SolutionDir)src\common\interop;../../;../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<OmitDefaultLibName>false</OmitDefaultLibName>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
<Link>
<AdditionalDependencies>WindowsApp.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -82,13 +80,11 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)src\common\interop;$(SolutionDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(SolutionDir)src\common\interop;../../;../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
<Link>
<AdditionalDependencies>WindowsApp.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -96,6 +92,12 @@
</DelayLoadDLLs>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(CIBuild)'!='true'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<AssemblyVersionFiles Include="Generated Files\AssemblyInfo.cpp" />
</ItemGroup>
@@ -122,23 +124,23 @@
<WriteLinesToFile File="Generated Files\AssemblyInfo.cpp" Lines="@(HeaderLines)" Overwrite="true" Encoding="Unicode" WriteOnlyWhenDifferent="true" />
</Target>
<ItemGroup>
<ClInclude Include="HotkeyManager.h" />
<ClInclude Include="interop.h" />
<ClInclude Include="KeyboardHook.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="Resource.h" />
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Generated Files\AssemblyInfo.cpp" />
<ClCompile Include="HotkeyManager.cpp" />
<ClCompile Include="interop.cpp" />
<ClCompile Include="KeyboardHook.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="app.rc" />
</ItemGroup>
<ItemGroup>
<Image Include="app.ico" />
<ResourceCompile Include="interop.rc" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />

View File

@@ -18,10 +18,16 @@
<ClInclude Include="interop.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Resource.h">
<ClInclude Include="pch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="pch.h">
<ClInclude Include="KeyboardHook.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="HotkeyManager.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="resource.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
@@ -35,15 +41,16 @@
<ClCompile Include="Generated Files\AssemblyInfo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="KeyboardHook.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="HotkeyManager.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="app.rc">
<ResourceCompile Include="interop.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<Image Include="app.ico">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
</Project>

View File

@@ -7,6 +7,8 @@
#ifndef PCH_H
#define PCH_H
#define WIN32_LEAN_AND_MEAN
// add headers that you want to pre-compile here
#include <Windows.h>
#endif //PCH_H

View File

@@ -20,7 +20,7 @@ struct ScreenSize
POINT middle() const { return { rect.left + width() / 2, rect.top + height() / 2 }; };
POINT middle_right() const { return { rect.right, rect.top + height() / 2 }; };
POINT bottom_left() const { return { rect.left, rect.bottom }; };
POINT bottm_midle() const { return { rect.left + width() / 2, rect.bottom }; };
POINT bottom_middle() const { return { rect.left + width() / 2, rect.bottom }; };
POINT bottom_right() const { return { rect.right, rect.bottom }; };
};

View File

@@ -36,6 +36,10 @@ namespace
namespace localized_strings
{
constexpr std::wstring_view SNOOZE_BUTTON = L"Snooze";
constexpr std::wstring_view PT_UPDATE = L"PowerToys update";
constexpr std::wstring_view DOWNLOAD_IN_PROGRESS = L"Downloading...";
constexpr std::wstring_view DOWNLOAD_COMPLETE = L"Download complete";
}
static DWORD loop_thread_id()
@@ -83,7 +87,7 @@ public:
{
return 1;
}
auto dispatcher = reinterpret_cast<decltype(dispatch_to_backround_handler)*>(GetProcAddress(lib, "dispatch_to_backround_handler"));
auto dispatcher = reinterpret_cast<decltype(dispatch_to_background_handler)*>(GetProcAddress(lib, "dispatch_to_background_handler"));
if (!dispatcher)
{
return 1;
@@ -204,7 +208,19 @@ void notifications::show_toast_with_activations(std::wstring message, std::wstri
toast_xml += title;
toast_xml += L"</text><text>";
toast_xml += message;
toast_xml += L"</text></binding></visual><actions>";
toast_xml += L"</text>";
if (params.progress)
{
toast_xml += LR"(<progress title=")";
toast_xml += localized_strings::PT_UPDATE;
if (params.subtitle)
{
toast_xml += L" ";
toast_xml += *params.subtitle;
}
toast_xml += LR"(" value="{progressValue}" valueStringOverride="{progressValueString}" status="{progressStatus}"/>)";
}
toast_xml += L"</binding></visual><actions>";
for (size_t i = 0; i < size(actions); ++i)
{
std::visit(overloaded{
@@ -294,6 +310,17 @@ void notifications::show_toast_with_activations(std::wstring message, std::wstri
toast_xml_doc.LoadXml(toast_xml);
ToastNotification notification{ toast_xml_doc };
if (params.progress)
{
float progress = std::clamp(params.progress.value(), 0.0f, 1.0f);
winrt::Windows::Foundation::Collections::StringMap map;
map.Insert(L"progressValue", std::to_wstring(progress));
map.Insert(L"progressValueString", std::to_wstring(static_cast<int>(progress * 100)) + std::wstring(L"%"));
map.Insert(L"progressStatus", localized_strings::DOWNLOAD_IN_PROGRESS);
winrt::Windows::UI::Notifications::NotificationData data(map);
notification.Data(data);
}
const auto notifier = winstore::running_as_packaged() ? ToastNotificationManager::ToastNotificationManager::CreateToastNotifier() :
ToastNotificationManager::ToastNotificationManager::CreateToastNotifier(WIN32_AUMID);
@@ -315,3 +342,30 @@ void notifications::show_toast_with_activations(std::wstring message, std::wstri
notifier.Show(notification);
}
void notifications::update_progress_bar_toast(std::wstring plaintext_message, toast_params params)
{
if (!params.progress.has_value())
{
return;
}
const auto notifier = winstore::running_as_packaged() ? ToastNotificationManager::ToastNotificationManager::CreateToastNotifier() :
ToastNotificationManager::ToastNotificationManager::CreateToastNotifier(WIN32_AUMID);
float progress = std::clamp(params.progress.value(), 0.0f, 1.0f);
winrt::Windows::Foundation::Collections::StringMap map;
map.Insert(L"progressValue", std::to_wstring(progress));
map.Insert(L"progressValueString", std::to_wstring(static_cast<int>(progress * 100)) + std::wstring(L"%"));
map.Insert(L"progressStatus", progress < 1 ? localized_strings::DOWNLOAD_IN_PROGRESS : localized_strings::DOWNLOAD_COMPLETE);
winrt::Windows::UI::Notifications::NotificationData data(map);
std::wstring tag = L"";
if (params.tag.has_value() && params.tag->length() < 64)
{
tag = *params.tag;
}
winrt::Windows::UI::Notifications::NotificationUpdateResult res = notifier.Update(data, tag);
}

View File

@@ -43,10 +43,13 @@ namespace notifications
{
std::optional<std::wstring_view> tag;
bool resend_if_scheduled = true;
std::optional<float> progress;
std::optional<std::wstring_view> subtitle;
};
using action_t = std::variant<link_button, background_activated_button, snooze_button>;
void show_toast(std::wstring plaintext_message, toast_params params = {});
void show_toast_with_activations(std::wstring plaintext_message, std::wstring_view background_handler_id, std::vector<action_t> actions, toast_params params = {});
void update_progress_bar_toast(std::wstring plaintext_message, toast_params params);
}

View File

@@ -3,4 +3,4 @@ DllCanUnloadNow = WINRT_CanUnloadNow PRIVATE
DllGetActivationFactory = WINRT_GetActivationFactory PRIVATE
DllRegisterServer PRIVATE
DllUnregisterServer PRIVATE
dispatch_to_backround_handler PRIVATE
dispatch_to_background_handler PRIVATE

View File

@@ -1,35 +1,36 @@
#include <windows.h>
#include "resource.h"
#include "../../../common/version.h"
#include "../version.h"
1 VERSIONINFO
FILEVERSION FILE_VERSION
PRODUCTVERSION PRODUCT_VERSION
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEVERSION FILE_VERSION
PRODUCTVERSION PRODUCT_VERSION
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
FILEFLAGS 0x0L
#endif
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE VFT2_UNKNOWN
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0" // English (0x0409), Unicode (0x04B0) charset
BLOCK "040904b0" // US English (0x0409), Unicode (0x04B0) charset
BEGIN
VALUE "CompanyName", COMPANY_NAME
VALUE "FileDescription", "PowerToys Notifications"
VALUE "FileDescription", FILE_DESCRIPTION
VALUE "FileVersion", FILE_VERSION_STRING
VALUE "InternalName", "PowerToys Notifications"
VALUE "InternalName", INTERNAL_NAME
VALUE "LegalCopyright", COPYRIGHT_NOTE
VALUE "OriginalFilename", "powertoys_notifications.dll"
VALUE "ProductName", "PowerToys Notifications"
VALUE "OriginalFilename", ORIGINAL_FILENAME
VALUE "ProductName", PRODUCT_NAME
VALUE "ProductVersion", PRODUCT_VERSION_STRING
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
VALUE "Translation", 0x409, 1200 // US English (0x0409), Unicode (1200) charset
END
END

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props')" />
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props')" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@@ -93,13 +93,11 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;NOTIFICATIONSDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpplatest</LanguageStandard>
<AdditionalOptions>/await %(AdditionalOptions)</AdditionalOptions>
<TreatWarningAsError>true</TreatWarningAsError>
@@ -117,11 +115,9 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;NOTIFICATIONSDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@@ -131,11 +127,9 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;NOTIFICATIONSDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpplatest</LanguageStandard>
<AdditionalOptions>/await %(AdditionalOptions)</AdditionalOptions>
<TreatWarningAsError>true</TreatWarningAsError>
@@ -151,13 +145,11 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;NOTIFICATIONSDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@@ -167,6 +159,12 @@
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(CIBuild)'!='true'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="cpp.hint" />
<None Include="notifications.def" />
@@ -180,15 +178,12 @@
<ItemGroup>
<ClCompile Include="dllmain.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets')" />
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets')" />
</ImportGroup>
<ItemGroup>
<ProjectReference Include="..\notifications_winrt\notifications.vcxproj">
@@ -202,7 +197,7 @@
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets'))" />
</Target>
</Project>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Windows.CppWinRT" version="2.0.200316.3" targetFramework="native" />
<package id="Microsoft.Windows.CppWinRT" version="2.0.200514.2" targetFramework="native" />
</packages>

View File

@@ -1 +1,13 @@
#include <windows.h>
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by notifications_dll.rc
//////////////////////////////
// Non-localizable
#define FILE_DESCRIPTION "PowerToys Notifications"
#define INTERNAL_NAME "Notifications"
#define ORIGINAL_FILENAME "Notifications.dll"
// Non-localizable
//////////////////////////////

View File

@@ -17,6 +17,6 @@ namespace winrt::PowerToysNotifications::implementation
return;
}
dispatch_to_backround_handler(details.Argument());
dispatch_to_background_handler(details.Argument());
}
}

Some files were not shown because too many files have changed in this diff Show More