question

Groovykool-9087 avatar image
1 Vote"
Groovykool-9087 asked ·

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

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

windows-uwp
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Groovykool-9087 avatar image
0 Votes"
Groovykool-9087 answered ·

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

· 4 · Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Back in the day, when grandma was a kid, when they "designed" WinRT, they thought the "sandbox" is such a cool concept, and basically they've created a lot of "limitations" because, well, some "smart guys" thought it's the way to go.

They haven't asked for any feedback from us, the developers actually using the platform.

Nobody likes UWP, exactly because it's based on WinRT, and sooner or later (usually sooner), you'll run into many of their limitations.

Like, for instance, you CANNOT resize your app when you want (there are many more).

There have been many outcries, and MS has created more and more APIs to "fix it". It's gotten better over the years, but the core issues are there.

0 Votes 0 · ·

Hi jtorjo,

UWP applications are still under development and more features will be added in the future. We will communicate with product group, thank you for your comment.

0 Votes 0 · ·

Hi, I'm sorry that this design has brought you confused. UWP apps that are set as StartupTask get launched as minimized/suspended by design. This is to ensure a good user experience for Store app by default and avoid having a ton of apps launch into the desktop on boot. If you really need it, you can initiate relevant suggestions in the Feedback Hub of the system.

0 Votes 0 · ·

Hello, is there any new progress in your question? If there are new questions, please feel free to ask

0 Votes 0 · ·
RichardZhang-MSFT avatar image
0 Votes"
RichardZhang-MSFT answered ·

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.

· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.