debugging-tools.md
1 # PowerToys Debugging Tools 2 3 PowerToys includes several specialized tools to help with debugging and troubleshooting. These tools are designed to make it easier to diagnose issues with PowerToys features. 4 5 ## FancyZones Debugging Tools 6 7 ### FancyZones Hit Test Tool 8 9 - Location: `/tools/FancyZonesHitTest/` 10 - Purpose: Tests FancyZones layout selection logic 11 - Functionality: 12 - Simulates mouse cursor positions 13 - Highlights which zone would be selected 14 - Helps debug zone detection issues 15 16 ### FancyZones Draw Layout Test 17 18 - Location: `/tools/FancyZonesDrawLayoutTest/` 19 - Purpose: Tests FancyZones layout drawing logic 20 - Functionality: 21 - Visualizes how layouts are drawn 22 - Helps debug rendering issues 23 - Tests different monitor configurations 24 25 ### FancyZones Zonable Tester 26 27 - Location: `/tools/FancyZonesZonableTester/` 28 - Purpose: Tests if a window is "zonable" (can be moved to zones) 29 - Functionality: 30 - Checks if windows match criteria for zone placement 31 - Helps debug why certain windows can't be zoned 32 33 ## Monitor Information Tools 34 35 ### Monitor Info Report 36 37 - Location: `/tools/MonitorPickerTool/` 38 - Purpose: Diagnostic tool for identifying WinAPI bugs related to physical monitor detection 39 - Functionality: 40 - Lists all connected monitors 41 - Shows detailed monitor information 42 - Helps debug multi-monitor scenarios 43 44 ## Window Information Tools 45 46 ### Styles Report Tool 47 48 - Location: `/tools/StylesReportTool/` 49 - Purpose: Collect information about an open window 50 - Functionality: 51 - Reports window styles 52 - Shows window class information 53 - Helps debug window-related issues in modules like FancyZones 54 55 ### Build Process 56 57 The Styles Report Tool is built separately from the main PowerToys solution: 58 59 ``` 60 nuget restore .\tools\StylesReportTool\StylesReportTool.sln 61 msbuild -p:Platform=x64 -p:Configuration=Release .\tools\StylesReportTool\StylesReportTool.sln 62 ``` 63 64 ## Shell-Related Debugging Tools 65 66 ### PowerRenameContextMenu Test 67 68 - Location: `/tools/PowerRenameContextMenuTest/` 69 - Purpose: Tests PowerRename context menu integration 70 - Functionality: 71 - Simulates right-click context menu 72 - Helps debug shell extension issues 73 74 ## Verification Tools 75 76 ### Verification Scripts 77 78 - Location: `/tools/verification-scripts/` 79 - Purpose: Scripts to verify PowerToys installation and functionality 80 - Functionality: 81 - Verify binary integrity 82 - Check registry entries 83 - Test module loading 84 85 ## Other Debugging Tools 86 87 ### Clean Up Tool 88 89 - Location: `/tools/CleanUp/` 90 - Purpose: Clean up PowerToys installation artifacts 91 - Functionality: 92 - Removes registry entries 93 - Deletes settings files 94 - Helps with clean reinstallation 95 96 ### Using Debugging Tools 97 98 1. Most tools can be run directly from the command line 99 2. Some tools require administrator privileges 100 3. Tools are typically used during development or for advanced troubleshooting 101 4. Bug Report Tool can collect and package the output from several of these tools 102 103 ## Adding New Debugging Tools 104 105 When creating new debugging tools: 106 107 1. Place the tool in the `/tools/` directory 108 2. Follow existing naming conventions 109 3. Document the tool in this file 110 4. Include a README.md in the tool's directory 111 5. Consider adding the tool's output to the Bug Report Tool if appropriate