Auto Startup a Metro App

前端 未结 1 1211
情话喂你
情话喂你 2021-01-23 07:02

I want to write a Windows 8 Metro App which starts automatically after the user\'s login.

For desktop apps I know how to do that, using a registry key or copying a link

1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-23 07:35

    This is not possible. Even if you can start it on startup [1], the app would get suspended in the background anyway. additionally, all metro apps show a splashscreen when started.

    What is it that you are trying to achieve? If its to run code, background tasks will do this, and do not require your app to start to be kicked off.

    If its to get in the MRU list, then this is auto managed but the system, and even if your app is there, it can be terminated, and aged out of the list at anytime.

    If you don't want to create a separate launch mechanism, you can register a protocol handler - eg. Myapp://stuff - and open that using standard ShellExecute functions to start your application.

    Note, you cannot bundle this application and have it placed in the startup group from an appx package. It has to be delivered out of band from the appx itself. Additionally, you cannot stop the splash screen being displayed.

    [1] since you are also asking to do something that you cannot do in package with win 8 store apps, you can create another exe which can use the supported APIs to launch the metro app. Placing this app in the startup group will have the behavior you want. The API you need it: http://msdn.microsoft.com/en-us/library/windows/desktop/Hh706903(v=vs.85).aspx

    0 讨论(0)
提交回复
热议问题