ispiro
ispiro

Reputation: 27653

Detect launch by UWP startupTask extension

I successfully got a Centennial app to auto launch at logon using a StartupTask inside appxmanifest as mentioned here. But I need to detect that that was how it was launched (as opposed to a user launching it manually.

How is that achieved?

I was thinking of using the StartupTask class for that, but couldn't find anything helpful there.

(While on the subject - how would I even use that class in a .net, since the reference to its assembly is not available for .net? See my other question on the subject.)

Upvotes: 3

Views: 216

Answers (1)

Stefan Wick  MSFT
Stefan Wick MSFT

Reputation: 13850

The only way to do this currently is by using a dedicated EXE for the StartupTask extension (i.e. different EXE from your application's entrypoint).

This way you know when you are being launched as StartupTask, and you can then launch your actual application with appropriate parameters from there.

Upvotes: 2

Related Questions