0

I would like to use a powershell script to focus/switch to a UWP (Windows app store style app) that is currently running.

I use powershell to focus a regular windows application by its process name just fine using a technique found here: How to bring focus to window by process name?

The problem I have using this technique with a UWP app is that UWP apps appear to have 0 as the MainWindowHandle property which tells me its hidden and managed by the system.

Rel
  • 2,494
  • 2
  • 15
  • 15
  • It can propably be done using UI Automation .NET API. https://learn.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-overview – zett42 Jun 22 '22 at 17:58
  • PowerShell sample: https://gist.github.com/xiongjia/6749035 (Note that the top-level window of UWP apps is managed by a different process than the app, so you have to search the child windows as well). – zett42 Jun 23 '22 at 10:30

0 Answers0