locked
Call another app with parameters in C# RRS feed

  • Question

  • Hello. I would like to start a new app in C#, but I would like to pass a variable to this app. How should I start the app with the variable, or how should the app receive the variable? Thank you.

    Sincerely, Jakeinc

    Thursday, November 7, 2013 11:38 PM

Answers

  • Nigel's close.

    You cannot directly start another app from your app, but you can launch a URI and have it open in the default handler for that URI. You can leverage this by having your app define a custom protocol which accepts the arguments you want to pass.

    The caveats are that the user gets to choose the default handler, so your app cannot depend on launching a specific app, and your app won't pass certification if it has a strong dependency on an external app.

    See: How to handle URI activation and How to launch the default app for a URI

    --Rob

    • Marked as answer by Jakeinc Friday, November 8, 2013 1:54 AM
    Friday, November 8, 2013 12:39 AM
    Moderator

All replies

  • You cant start another app from your app.

    The only way would be to have the user start both apps and pass data between them via a file.


    n.Wright

    Thursday, November 7, 2013 11:46 PM
  • Nigel's close.

    You cannot directly start another app from your app, but you can launch a URI and have it open in the default handler for that URI. You can leverage this by having your app define a custom protocol which accepts the arguments you want to pass.

    The caveats are that the user gets to choose the default handler, so your app cannot depend on launching a specific app, and your app won't pass certification if it has a strong dependency on an external app.

    See: How to handle URI activation and How to launch the default app for a URI

    --Rob

    • Marked as answer by Jakeinc Friday, November 8, 2013 1:54 AM
    Friday, November 8, 2013 12:39 AM
    Moderator