简体   繁体   English

通过UWP startupTask扩展检测启动

[英]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 . 我顺利地拿到了在登录时使用一百年应用自动启动StartupTaskappxmanifest提到这里 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. 我正在考虑使用StartupTask类 ,但在那里找不到任何有用的东西。

(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 .) (关于这个问题 - 我怎么会在.net中使用该类,因为对它的汇编的引用不适用于.net?请参阅我关于该主题的其他问题 。)

The only way to do this currently is by using a dedicated EXE for the StartupTask extension (ie different EXE from your application's entrypoint). 目前唯一的方法是使用专用的EXE作为StartupTask扩展(即应用程序入口点的不同EXE)。

This way you know when you are being launched as StartupTask, and you can then launch your actual application with appropriate parameters from there. 这样您就可以知道何时作为StartupTask启动,然后您可以从那里启动具有适当参数的实际应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM