Windows system utilities to maximize productivity
Go to file
ryanbodrug-microsoft c4cb3df306
Adding FxCop to Microsoft.Plugin.WindowWalker (#6260)
* Adding FxCop to Microsoft.Plugin.WindowWalker

* Delete WindowResult.cs -- Fix for CA1812 WindowResult 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).

* Fix for CA1806 UpdateOpenWindowsList calls EnumWindows 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.

* Fix for: CA1066 Type Microsoft.Plugin.WindowWalker.Components.InteropAndHelpers.RECT should implement IEquatable<T> because it overrides Equals

* Fix for:  CA1052 Type 'FuzzyMatching' is a static holder type but is neither static nor NotInheritable

* Suppress for CA1069 - These values are defined in
https://docs.microsoft.com/en-us/windows/win32/winmsg/extended-window-styles.

CA1069 The enum member 'WS_EX_LTRREADING' has the same constant value '0' as member 'WS_EX_LEFT'
CA1069 The enum member 'WS_EX_RIGHTSCROLLBAR' has the same constant value '0' as member 'WS_EX_LEFT'

* Supress CA1069

Code Description
CA1069 The enum member 'SWP_NOREPOSITION' has the same constant value '512' as member 'SWP_NOOWNERZORDER'
CA1069 The enum member 'SWP_FRAMECHANGED' has the same constant value '32' as member 'SWP_DRAWFRAME'

* Suprress CA1069 for ShowWindow values.  See

https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-showwindow

CA1069 The enum member 'ShowMaximized' has the same constant value '3' as member 'Maximize'

* Fix code formatting error

* Fix for CA2235: Making POINT serializable

CA2235 Field MinPosition is a member of type WINDOWPLACEMENT which is serializable but is of type Microsoft.Plugin.WindowWalker.Components.InteropAndHelpers.POINT which is not serializable
CA2235 Field MaxPosition is a member of type WINDOWPLACEMENT which is serializable but is of type Microsoft.Plugin.WindowWalker.Components.InteropAndHelpers.POINT which is not serializable

* Fix CA2235 Making RECT serializable

CA2235 Field NormalPosition is a member of type WINDOWPLACEMENT which is serializable but is of type Microsoft.Plugin.WindowWalker.Components.InteropAndHelpers.RECT which is not serializable

* Fixes for CA2101 Specify marshaling for P/Invoke string arguments.

* Fixes for CA2007 Consider calling ConfigureAwait on the awaited task

* Fixes for the following (CA1822 / CA1801):
CA1822 Member 'OnOpenWindowsUpdate' does not access instance data and can be marked as static
Code Description
CA1801 Parameter value of method add_OnOpenWindowsUpdate is never used. Remove the parameter or use it in the method body.
CA1801 Parameter value of method remove_OnOpenWindowsUpdate is never used. Remove the parameter or use it in the method body.

* Fix: CA1710 Rename OpenWindowsUpdateHandler to end in 'EventHandler'

* Fix CA1822 Member 'GetProcessIDFromWindowHandle' does not access instance data and can be marked as static

* Fix CA1062 In externally visible method 'List<int> FuzzyMatching.FindBestFuzzyMatch(string text, string searchText)', validate parameter 'searchText' 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.

* Fixes for CA1304 The behavior of 'string.ToLower()' could vary based on the current user's locale settings.

CA1304 The behavior of 'string.ToLower()' could vary based on the current user's locale settings. Replace this call in 'FuzzyMatching.FindBestFuzzyMatch(string, string)' with a call to 'string.ToLower(CultureInfo)'.

Code Description
CA1304 The behavior of 'string.ToLower()' could vary based on the current user's locale settings. Replace this call in 'FuzzyMatching.FindBestFuzzyMatch(string, string)' with a call to 'string.ToLower(CultureInfo)'.

* Supressing warning for CA1814: Prefer jagged arrays over multidimensional however this might be something to consider if needing to optimize the window walker search.

* Fix: CA1062 In externally visible method 'List<List<int>> FuzzyMatching.GetAllMatchIndexes(bool[,] matches)', validate parameter 'matches' 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.

* Fix for CA1062 In externally visible method 'int FuzzyMatching.CalculateScoreForMatches(List<int> matches)', validate parameter 'matches' 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.

* Fixes for CA1806 Calls x...  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.

Using discard for methods that return void, and checking the hresult before returning parameters.

* Fix for CA1820 Test for empty strings using 'string.Length' property or 'string.IsNullOrEmpty' method instead of an Equality check

* Supress CA1031 Modify 'get_WindowIcon' to catch a more specific allowed exception type, or rethrow the exception

* Code Description
CA1062 In externally visible method 'List<Result> Main.Query(Query query)', validate parameter 'query' 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.

* Fixes For CA1304 The behavior of 'string.ToUpper()' could vary based on the current user's locale settings.

CA1304 The behavior of 'string.ToLower()' could vary based on the current user's locale settings. Replace this call in 'SearchController.SearchText.set' with a call to 'string.ToLower(CultureInfo)'.
CA1304 The behavior of 'string.ToLower()' could vary based on the current user's locale settings. Replace this call in 'Window.ProcessName.get' with a call to 'string.ToLower(CultureInfo)'.
CA1304 The behavior of 'string.ToLower()' could vary based on the current user's locale settings. Replace this call in 'Window.SwitchToWindow()' with a call to 'string.ToLower(CultureInfo)'.
CA1304 The behavior of 'string.ToUpper()' could vary based on the current user's locale settings. Replace this call in 'Window.ToString()' with a call to 'string.ToUpper(CultureInfo)'.
CA1307 The behavior of 'string.Equals(string?)' could vary based on the current user's locale settings. Replace this call in 'Microsoft.Plugin.WindowWalker.Components.Window.SwitchToWindow()' with a call to 'string.Equals(string?, System.StringComparison)'.

* Fix: CA1710 Rename SearchResultUpdateHandler to end in 'EventHandler'

* Fix CA1060 Move pinvokes to native methods class

* Fix: CS0067 The event 'OpenWindows.OnOpenWindowsUpdateEventHandler' is never used

1) Remove SearchController::OpenWindowsUpdateHandler(object sender, SearchResultUpdateEventArgs e) as it wasn't being called and was redundant with Update Search Text.
2) In Main.cs calling UpdateOpenWindowsList before UpdateSearchText so that the latest enumerated windows will be called.
3) Removing unused OnOpenWindowsUpdateEventHandler and related code.

* Revert "Fixes for CA2101 Specify marshaling for P/Invoke string arguments."

This reverts commit b3dfe07915.

* Fixing CA2101 by turning off best fit mapping for methods that require ANSI marshalling.

See: https://docs.microsoft.com/en-us/visualstudio/code-quality/ca2101?view=vs-2019

* Previous fix for CA1806 misunderstood int result as hresult.  The actual return value is number of characters written.
NativeMethods.GetWindowText(hwnd, titleBuffer, sizeOfTitle);

* Previous fix for CA1806 misunderstood int result as hresult.  The actual return value is number of characters written.

NativeMethods.GetClassName(Hwnd, windowClassName, windowClassName.MaxCapacity);

* Removing unused window code.  This was done instead of validating fxcop changes in WindowIcon.

* Fixing typos in Window.cs (charachter -> character)
2020-09-10 09:44:22 -07:00
.github Implement #6312 (#6315) 2020-09-03 09:19:00 -07:00
.pipelines Create unit tests for Calculator plugin (#6356) 2020-09-09 20:01:30 -07:00
doc Updated links under "How to create new PowerToys" (#6412) 2020-09-06 18:02:36 +02:00
installer installer: reduce notification spam 2020-09-09 12:50:31 +03:00
src Adding FxCop to Microsoft.Plugin.WindowWalker (#6260) 2020-09-10 09:44:22 -07:00
tools tools: add wmi monitor info powershell script 2020-09-07 15:47:40 +03:00
.gitattributes Update .gitattributes to make line endings consistent (#5942) 2020-08-14 11:38:10 -07:00
.gitignore Add SVG Thumbnail Provider for Windows Explorer (#5048) 2020-07-21 16:27:12 -07:00
CODE_OF_CONDUCT.md adding in a Code of Conduct 2020-03-05 10:11:27 -08:00
community.md Update community.md 2020-08-28 10:09:06 -07:00
contributing.md FancyZones and Shortcut Guide initial commit 2019-09-05 18:12:40 +02:00
LICENSE Fix license file (#2626) 2020-05-02 15:59:18 -07:00
NOTICE.md Update NOTICE.md 2020-07-27 15:37:27 -07:00
nuget.config Clearing any nuget configuration that might be coming from parent directories, fixes #4595 2020-06-30 08:50:53 +02:00
PowerToys.sln Create unit tests for Calculator plugin (#6356) 2020-09-09 20:01:30 -07:00
README.md Updated .exe installer version number from 0.21.0 to 0.21.1 (#6355) 2020-09-04 12:15:02 -07:00
SECURITY.md Create SECURITY.md 2020-07-17 14:45:18 -07:00

Overview

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, 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.

What's Happening | Downloading & Release notes | Contributing to PowerToys | Known issues

Build status

Branch Status x64
Master Build Status for Master
Stable Build Status for Stable
Installer Build Status for Installer

Current PowerToy Utilities

Color Picker

ColorPicker is a simple and quick system-wide color picker with Win+Shift+C. Color Picker allows to pick colors from any currently running application and automatically copies the HEX or RGB values to your clipboard. This code is based on Martin Chrzan's Color Picker.


FancyZones

FancyZones is a window manager that makes it easy to create complex window layouts and quickly position windows into those layouts.




File Explorer Add-ons

File Explorer add-ons will enable SVG icon rendering and 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)

Image Resizer

Image Resizer 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.



Keyboard Manager

Keyboard Manager 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.



PowerRename

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.

PowerToys Run

PowerToys Run 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.


Shortcut Guide

Windows key 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.



Video Conference Mute (Experimental)

Video Conference Mute is a quick and easy way to do an global "mute" of both your microphone and webcam via Win+N. Just set your webcam in the target application to the PowerToys VideoConference camera.

Note: This is only included in the pre-release version of PowerToys installer. This PowerToy requires Windows 10 1903 (build 18362) or later.


Installing and running Microsoft PowerToys

Requirements

  • Windows 10 1803 (build 17134) or later.
  • Have .NET Core 3.1 Desktop Runtime. The installer should handle this but we want to directly make people aware.

0.18 users for updating via notifications

  • We adjusted how upgrading works in 0.20. In 0.19 we accounted for this upcoming change but if you are going from 0.18 to 0.21, please directly use the installer file.

Install from the Microsoft PowerToys GitHub releases page. Click on Assets to show the files available in the release and then click on PowerToysSetup-0.21.1-x64.exe to download the PowerToys installer.

This is our preferred method.

Via WinGet (Preview)

Download PowerToys from WinGet. To install PowerToys, run the following command from the command line / PowerShell:

WinGet install powertoys

Other install methods

There are community driven install methods such as Chocolatey and Scoop. If these are your perferred install solutions, this will have the install instructions.

Known issues

  • Color Picker at times won't work when PT is running elevated - #5348. We are currently working on a fix now for this.

Processor support

We currently support the matrix below.

x64 x86 ARM
Supported Issue #602 Issue #490

What's Happening

August 2020 Update

Our goals for 0.21 release cycle was to focus on stability, localization and quality of life improvements for both the development team and our end users.

One of the longer term goal items we have made progress on is the Out of Box experience / initial onboarding experience (OOBE) improvements.@Niels9001 created a wicked awesome proof of concept of what the OOBE experience could be. We are pretty stoked about this since it handles one an important item, critical shortcut default adjustments.

Highlights from August

PT Run:

  • Removed need for space in action keywords. This means you now can type >ipconfig
  • Icon caches fixed and now has colored icons
  • Improved font rendering via ClearType (Shout out to @AnuthaDev doing the heavy lifting here)
  • Result speed improvements
  • URLs are supported
  • Fixed bugs including calculating bugs

FancyZone:

  • Win+Arrow key is directional based on zone rect
  • Fixed bugs

Runner:

  • Fixed toast notifications running elevated from non-admin account

Shortcut Guide:

  • Improved vkey catching which will fix some use cases of it not showing up

SVG in File Explorer:

  • Embedded image tags will now render in Explorer

Color Picker:

  • Fixed bug where it would launch via false positive keystrokes

Accessibility:

  • Settings, PT Run and KBM undergoing improvements

Localization:

  • Pipeline is now setup and will be doing a full E2E pass on all utilities shortly.

Dev quality of life improvements:

  • Continued warning count reduction. This release ~80 removed
  • StyleCop enabled E2E
  • FxCop starting to be added in E2E

New experiential PowerToys utility - Video conference muting:

Note: This is only included in the pre-release version of PowerToys installer. This PowerToy requires Windows 10 1903 (build 18362) or later.

Back in the June timeframe, we started prototyping an idea. With COVID-19, we're all multi-tasking and trying to make the best of everything and being able to quickly mute while on a conference call is critical regardless of where you are on your computer and what application has focus.

The utility will mute not just your audio but your video as well with a single keystroke. You can do audio, video both. We knew this would impact our roadmap and goals but felt extremely strong that this is the right decision. We're all multi-tasking and trying to make the best of everything and being able to quickly mute while on a conference call is critical regardless of where you are on your computer.

We know we have some issues and we have a master tracking issue - #6246. We know a certain laptops currently the video forwarding does not work and are proactively working on fixing this.

To use:

  • Set your camera to the PowerToys Video driver in the target application
  • Win+N to toggle both Audio and Video at the same time
  • Win+Shift+O to toggle video
  • Win+Shift+A to toggle microphone

For a more information, head over to the Video conference mute overview

What is being planned for 0.23

For 0.23, we are proactively working on:

  • Stability
  • Localization
  • Improve interactions with elevated windows and keeping most of the PT utilities non-elevated so we still have a 'shell' like experience
  • OOBE work

PowerToys roadmap

Our prioritized roadmap of features and utilites that the core team is focusing on..

Developer Guidance

Please read the developer docs for a detailed breakdown.

Contributing

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. 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.

⚠ State of code ⚠

PowerToys is still a very fluidic project and the team is actively working out of this repository. We will be periodically re-structuring/refactoring the code to make it easier to comprehend, navigate, build, test, and contribute to, so DO expect significant changes to code layout on a regular basis.

License Info

Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct.

Privacy Statement

The application logs basic telemetry. Our Telemetry Data page (Coming Soon) has the trends from the telemetry. Please read the Microsoft privacy statement for more information.