In an UWP app, how can I get all currently open `Window` instances?

See title I want to get all open windows, and get their Window instances, I also want to get a callback whenever a new Window is opened Using WinUI 2
8 Replies
Lordzipzap
Lordzipzap4w ago
hey man try using pywin pywinauto *
jcotton42
jcotton424w ago
This is UWP, Python isn’t applicable.
Lordzipzap
Lordzipzap4w ago
Unfortunate i have no exp with uwp
leowest
leowest4w ago
I mean its a c# discord why did u even expect python to be the solution?
Lordzipzap
Lordzipzap4w ago
Yes i made a mistake Danm, i am being punished for sugessting something
reflectronic
reflectronic4w ago
you will almost certainly need a full trust app service it allows you to write a separate application which runs without the UWP app container. and then, you just use the normal APIs for this you will have to do some back-and-forth communication between it and your main app using the app service API
reflectronic
reflectronic4w ago
@ref *&Sergio wrote a library to make this easier https://devblogs.microsoft.com/ifdef-windows/microsoft-store-open-source-series-appservices-library/ if you have specific questions about it, i am sure he can help
Sergio Pedri
#ifdef Windows
Microsoft Store Open Source Series — AppServices library - #ifdef W...
Introducing the AppServices library we built for the Microsoft Store to manage full trust Desktop extensions, and how you can use it in your UWP apps too!
Reabstraction
Reabstraction4w ago
I mean like for that app Not every app Just the one UWP app