UWPSpy
Introducing UWPSpy, an inspection tool for UWP and WinUI 3 applications that enables to view and manipulate UI elements and their properties in real time.
I’ve been interested in UWP since the release of Windows 11, where the taskbar UI was reimplemented using a new technology called XAML Islands. I created UWPSpy after gaining some experience with UWP. UWPSpy makes it easy to experiment with UWP UI elements and see how various changes behave before making them permanent. One example where UWPSpy comes in handy is with the Windows 11 Taskbar Styler mod, refer to its details page to see examples of UI customizations that are possible.
Download
UWPSpy.zip (413.33 kB)
Usage
- Run UWPSpy.exe and select the UWP/WinUI 3 application you want to spy on.
- A window with the application’s UI elements will appear for each UI thread of the target application.
Source code
https://github.com/m417z/UWPSpy
This is amazing! Features I’d like to see are..
Restore to default, Backups
Undo, redo
Color picker
Dark mode
Please tell me how to find the property responsible for the spacing between icons in the tray.
The spacing is controlled by two parameters:
MinWidth
of theNotifyIconView
element, set to32
on my computer.Padding
of the grid child element marked on the screenshot, set to4
on my computer.The
MinWidth
value can be configured by the Windows 11 Taskbar Styler mod as can be seen on the screenshot. The grid element isn’t accessible by a name or an indicative type, so customizing its padding by the mod will require more effort. Still, with justMinWidth
the width can be reduced from32
to24
, and set to any value above24
.Thanks. MinWidth works. What kind of effort is required for padding?
You can use the following:
Target:
systemtray:ImageIconContent > Grid
Style:
Padding=0
Thanks again. Could you tell me an algorithm for finding such things via UWPSpy. I would like to try to reduce the spacing of the left group of buttons (start menu…).
You can watch the demo video at the top of this page to get some inspiration.
Feeling somewhat stupid, but I have UWPSpy and I watched the demo and I still don’t understand how to select and change taskbar icons.
I opened UWPSpy and I had notepad open and I was able to select it from processes and view/select items.
I’m assuming the taskbar would be under Explorer, but I had three Explorer windows and selecting any of them and clicking Spy didn’t seem to do anything …
Hi Michael :),
What if someone wants to make the changes permanent?
Is there a solution for this? Maybe Resource Hacker? A new generator?
Hi,
An equivalent for Resource Hacker could probably be some .pri file editor, but currently, there isn’t even a public tool to parse and view those files properly. Probably the best thing out there is PRIExplorer, but it’s not maintained and doesn’t support new files. Keeping it up-to-date it isn’t simple, and implementing editing is even more challenging. Also, for store apps, normally the user doesn’t have permissions to edit the app files.
An alternative approach is to do the customization in runtime. For the taskbar, there’s the Windows 11 Taskbar Styler Windhawk mod. For the start menu, there’s Windows 11 Start Menu Styler. For the latter, there isn’t actually anything specific to the start menu in the mod, so you can try and target other processes with it to customize them. It’s not fully tested and supported, but should work. Let me know if you need help with setting it up.
is it possible to change the size of the titlebar buttons (minimize, maximize, close)?
Not with UWPSpy, as these are native buttons. As for other methods, I’m not familiar with a way to customize it.
Hello, is it possible to target Start menu search with this?
Hi, see my answer here:
https://github.com/m417z/UWPSpy/issues/3#issuecomment-1984719018
Hello, Michael, and thank you for this really cool tool!
Would it be possible to offset the taskbar icons to the left, while still keeping them centered? I have a 2560×1080 monitor and it leads to a worse reading experience for viewers whenever I stream on Discord. Lately, I’ve been toying with the idea of streaming my screen partially, and while I’ve made progress on the steps needed, the taskbar icons being aligned more to the right on-stream would likely bug me to no end lol.
Here’s a screenshot of what I mean: https://i.imgur.com/EVZbRlg.png
Thank you!
Hi,
You can add a margin on the right to the taskbar icons with the Windows 11 Taskbar Styler mod by adding the following target:
Microsoft.UI.Xaml.Controls.ItemsRepeater#TaskbarFrameRepeater
And style:
Margin=0,0,300,0
Adjust the right margin (300) as needed.
Thank you so much!!
It works like a charm, although one small nitpick would be that the start menu is now understandably no longer aligned to the taskbar icons. Would it possible to add a margin on the right to it too, perhaps with the Windows 11 Start Menu Styler?
Screenshot for reference: https://i.imgur.com/9CsAQI3.png
Yes, you can adjust the distance of the start menu from the left edge of the screen with:
Target:
StartDocked.StartSizingFrame
Style:
Canvas.Left=100
Replace 100 as needed.
You can discover adjustments like this by experimenting with UWPSpy.
Thank you, thank you, thank you!!!
Apologies for leeching off your knowledge, I did play around with UWPSpy for a while, but I’m really not familiar with XAML (?) so I wasn’t able to figure out much by myself. I really appreciate you taking the time to help me, though! Have a great day/night!
Can I use this to identify specific taskbar program icons so I can use that as a target parameter with the Border function of the windhawk taskbar styler?
I want to add a left or right border to some so that I can effectively group them according to function without adding a space-wasting blank icon.
You should be able to target a taskbar button by its text content like this:
Taskbar.TaskListButton[AutomationProperties.Name=UWPSpy - Ramen Software - Google Chrome - 1 running window]
It’s not perfect, as the title can change. Also, the title is only matched when the taskbar button is created.
I’m not sure there’s a better solution, but you can look for various properties in UWPSpy and look for anything that works better for you.
Hey, I used ExplorerPatcher to get the Windows 10 taskbar instead of the Win11 one, and it seems this doesn’t detect that taskbar. How would I go about this?
Hi, the Windows 10 taskbar uses native UI, not UWP or WinUI 3, so UWPSpy isn’t relevant for it.
Oh yikes. And is there any way to get the reveal brush or border effect on the Win11 Taskbar items?
I don’t know, you can try creating an issue here, maybe somebody will be able to provide an answer or a hint:
https://github.com/ramensoftware/windows-11-taskbar-styling-guide/issues
Hi. Is it possible to get the control center (or system tray popouts in general) with this tool? UWP seems to be able to retreive it but not all the popouts and elements… Im trying to use this in pair with windhawk for customization purposes
Hi, it should be possible, but if the popouts are closed when the focus switches to UWPSpy then it might be tricky.
I invite you to join the Windhawk Discord server where we discuss this kind of stuff.