locked
Is it possible to auto start a windows store app when windows 8 boots up?

    Question

  • Merry Christmas and Happy New Year!

    I am new to Windows store app and trying to port a set of android applications to Windows 8. Could anybody help me with the following questions?

    (1). On Android, there is activity with UI and service without UI running background. Does Windows 8 have such service-like thing? Or Can a Windows store app works as a service?

    (2). Is it possible to auto start a windows store app when windows 8 boots up?

    (3). Is there a way to allow two Windows store apps to exchange customer-defined messages?

     

    Thursday, December 27, 2012 1:08 AM

Answers

  • 1 http://blogs.msdn.com/b/windowsappdev/archive/2012/05/24/being-productive-in-the-background-background-tasks.aspx

    2 To start a modern UI application you need IApplicationActivationManager::ActivateApplication (desktop app only). You can write a desktop launcher for the app and run it at boot time. Note such application won't pass Microsoft's desktop app certification.

    3 only if they are in the same package.



    Visual C++ MVP


    Thursday, December 27, 2012 1:44 AM

All replies

  • 1 http://blogs.msdn.com/b/windowsappdev/archive/2012/05/24/being-productive-in-the-background-background-tasks.aspx

    2 To start a modern UI application you need IApplicationActivationManager::ActivateApplication (desktop app only). You can write a desktop launcher for the app and run it at boot time. Note such application won't pass Microsoft's desktop app certification.

    3 only if they are in the same package.



    Visual C++ MVP


    Thursday, December 27, 2012 1:44 AM
  • Hi, Sheng Jiang,

    Thanks a lot for you reply. It's very helpful.

    Actually, what we want to do is

    1. always have a task running background, communicating with a remote server, receiving orders; (On your help, I realized we could do this step using background task)

    2. based on the received order, open different application; And send the details of the order to the app (Is it possible? I found only active app in foreground can receive progress/completion events from background task.)

    Conica

    Thursday, December 27, 2012 2:45 AM
  • You can have scheduled notifications with launch parameter to let the user choose to launch your app when another app is in the foreground. You can then launch another app within your package when the user respond to your notification.

    Launching apps from background without user action is not a good idea even for desktop app (remember the pre-popup-blocker days?), let alone for a full screen metro app.


    Visual C++ MVP


    Thursday, December 27, 2012 7:29 PM
  • Hi, Sheng Jiang,

    Could I define a customized URI, pass the received order through the URI and launch my app using Windows.System.Launcher.launchUriAsync method? I tried the association launching example and it seems this method fits well in my case. 

    Is this method easier than scheduled notifications?

    Conica

    Monday, December 31, 2012 2:46 AM
  • Hi, Shengjiang,

    Another question is: can I terminate/suspend an app through notifications from a background task? or can I terminate/suspend an app from the app itself? I can not find such methods from Windows Store App Docs.

    Conica 

    Monday, December 31, 2012 5:46 AM
  • Yes you can launch via url and launch a url that the app's response is to close itself. But you got a lot of user education to do if your scheduled task open and closes metro apps. This kind of job is often running dedicated machines whose only purpose is to run those tasks because those seemly random popups made the machine useless for many other tasks, like document editing or email writing.


    Visual C++ MVP

    Monday, December 31, 2012 8:26 PM