Skip to content

How To Hack FancyZones

Background

A while back, I created a fork of the Microsoft PowerToys module, FancyZones, to take a stab at implementing a seemingly impossible to implement feature: Maximizing Windows Within A Zone.

My code can be found here: https://github.com/peddamat/PowerToys - See my changes: FancyZones Diff

FancyZones user, Taloth, provided code for his implementation: https://github.com/peddamat/PowerToys/discussions/5


Development Environment Setup

Getting The Code

# Clone repository and submodules
git clone https://github.com/peddamat/PowerToys.git
git submodule update --init --recursive

Opening The Solution

Open the PowerToys.sln:

Pasted image 20230210155820.png

If this notice pops up in your Solution Explorer, go ahead and click Install:

Pasted image 20230214150824.png


Building Solution

To build Fancy Zones, you need to build the entire solution, which you do, using Build -> Build Solution.

Pasted image 20230213114228.png

Builds take long enough for build failures to be painful. To maximize your chances at success, it's best to always do a Build -> Clean Solution before triggering a build.

Alternatively, you can go into src\modules\previewpane and type:

git clean -xfd .

Debugging FancyZones

The FancyZones module can be debugged by setting the Solution's "Startup Project" to FancyZones.

Pasted image 20230213143454.png


Building A Release

The installer is a separate solution found in the \installer subfolder of the project.

Pasted image 20230213144016.png

A release can be built by typing the following commands in the root PowerToys folder:

git clean -xfd

msbuild -t:build -restore -p:RestorePackagesConfig=true /p:Configuration=Release /p:Platform=x64 PowerToys.sln

msbuild -t:build -restore -p:RestorePackagesConfig=true /p:Configuration=Release /p:Platform=x64 tools\BugReportTool\BugReportTool.sln

msbuild -t:build -restore -p:RestorePackagesConfig=true /p:Configuration=Release /p:Platform=x64 tools\WebcamReportTool\WebcamReportTool.sln

msbuild -t:build -restore -p:RestorePackagesConfig=true /p:Configuration=Release /p:Platform=x64 tools\StylesReportTool\StylesReportTool.sln

msbuild -t:build -restore -p:RestorePackagesConfig=true /p:Configuration=Release /p:Platform=x64 installer\PowerToysSetup.sln

References


Last update: 2023-03-30