Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How to get command line arguments for a running app (non UWP)?

Discussion in 'Windows' started by hippogames, Aug 21, 2023.

  1. hippogames

    hippogames

    Joined:
    Feb 5, 2015
    Posts:
    232
    Hello! I've got a classic Windows app that can handle custom URI schemas, and thus can be launched from a web browser. It's a single instance app. How can I get command line arguments when the app is activated?
    Environment.GetCommandLineArgs() returns arguments for the first app launch only, so it's not suitable. OnDeepLinkActivated doesn't work for Standalone. Is there any alternatives to Application.OnActivated in UWP?

    The second scenario is a text/image editor. I want to use [Open With] on multiple files and open them inside my app in different tabs.

    Is it even possible with Unity?
     
  2. hippogames

    hippogames

    Joined:
    Feb 5, 2015
    Posts:
    232