[UWP][C#] How can I have an app that uses StartupTask Class to start on login, Stay in the foreground?

Groovykool 236 Reputation points
2019-12-20T00:07:10.877+00:00

I have an app setup so the user can have it run on windows login/boot. I use the UWP StartupTask Class. This basically works. The app starts, briefly shows the splash screen and then minimizes to the taskbar. (Enters Background).

How can I have the app start automatically and stay in the foreground like a normal launch? Or how can I reopen the window to the Foreground from code?

Thanks,
Tony

Universal Windows Platform (UWP)
0 comments No comments
{count} vote

Accepted answer
  1. Groovykool 236 Reputation points
    2019-12-20T04:33:24.093+00:00

    I'm confused. Why have a workaround and not just allow it. All StartupTasks have to be approved by the user?


1 additional answer

Sort by: Most helpful
  1. Richard Zhang-MSFT 6,936 Reputation points
    2019-12-20T02:56:35.947+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    For security reasons, UWP applications have some limitations.

    There is currently no API provided for application to wake itself from a minimized state to the foreground.

    You can try this:

    Create a Win32 App that can start on boot. Use this App to launch UWP application through the Launcher. Then you can package them with Desktop Bridge

    Thanks.

    0 comments No comments