Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have already made my metro app based on PC security and its working fine.

I want to start this metro app on Windows Startup, for that i have made a Windows Service so that it can start my metro app.

Problem : How to start a metro app from Windows Service ?

I have googled it alot but couldn't find any solution working for me..

Any change shouldd be done in my metro app so that it can start from other process ??

I have tried till Now :

Method-1
VB
Process.Start("redhawk:\\")

I have given "redhawk" as my metro app's protocol name.

Method-2
VB
Process.Start("metro.bat")


And the contents of
VB
metro.bat
is as follows :
VB
start "" "redhawk:"



Note : The 2nd method starts my metro app but it stucks on the splash screen. Should i change something in my metro app to avoid this ??

I have also read about OnActivated() event but couldn't apply it successfully..

Please Help Me As Soon As You Can... Thanks in advance...
Posted

1 solution

XML
I don't believe this is possible.  Every action a Windows 8 application takes must be made by user interaction, and so starting it automatically would be against that rule.  You should, however, be able to add a background task that can gather data in the background while your app isn't running.  Have you considered that?

here's a great sample that shows how to implement a background agent, in JS, C#, VB, and C++:


http://code.msdn.microsoft.com/windowsapps/Background-Task-Sample-9209ade9
 
Share this answer
 
Comments
vivek.khatri 25-Mar-13 10:32am    
Thanks for the reply..

yes i know about the background task, but actually i am trying to authenticate the user from my metro app therefore it can't be done by background task. I need some user interaction to authenticate the user.

in fact i wanted my metro app to be launched at the windows login time but as its not possible, i am trying to authenticate the user after windows login.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900