The following forum(s) are migrating to a new home on Microsoft Q&A (Preview): Developing Universal Windows apps!

Ask new questions on Microsoft Q&A (Preview).
Interact with existing posts until December 13, 2019, after which content will be closed to all new and existing posts.

Learn More

 none
UWP How to run multiple instances of an app? RRS feed

  • Question

  • I have an UWP app which opens files (through File Association Declaration). Each time I open a file the app runs OnFileActivated and runs the app with the file content or updates the app content in case the app were already open.

    My question is: How can i made the app run a new instance each time the user opens a file and loads the file content (Like for example Notepad.exe, each time you open a .txt file the app opens the file in a new instance). I Know this can be possible through Microsoft Edge can run multiple instances.

    Thanks in advance.

    Tuesday, January 26, 2016 7:26 AM

Answers

  • Multiple views should be what you are looking for.

    But remember to give the user some sort of window management inside your own app.

    Tuesday, January 26, 2016 8:49 AM
  • Windows Store apps are single instance. Windows allows only one instance of a Windows Store app to run at a time on the system. This conserves memory because multi-instance apps would each have their own memory. Because most apps have a single window, switching between apps is simpler for end users. Instead of seeing many windows they can switch to, users now see fewer windows. However, this makes your app more complex because you must now write the code to manage multiple documents or tabs yourself. 

    For  Microsoft Edge, it just like multiply views you have read.

    Tuesday, January 26, 2016 9:42 AM
  • Wednesday, January 27, 2016 12:57 AM

All replies

  • You can display multiple frames, but I suggest against using multiple instances. There are all sorts of funny issues when there are  multiple instances of the same application running.
    Tuesday, January 26, 2016 7:29 AM
  • Thanks for your fast answer

    What looks like "Multiple frames"? I red something about Multiple views of the app which is different from multiple instances. I think my question now is different: I need to run multiple windows of the same app, in order to run different files at the same type, maybe that can be done without "multiple instances".

    Tuesday, January 26, 2016 7:39 AM
  • Multiple views should be what you are looking for.

    But remember to give the user some sort of window management inside your own app.

    Tuesday, January 26, 2016 8:49 AM
  • Windows Store apps are single instance. Windows allows only one instance of a Windows Store app to run at a time on the system. This conserves memory because multi-instance apps would each have their own memory. Because most apps have a single window, switching between apps is simpler for end users. Instead of seeing many windows they can switch to, users now see fewer windows. However, this makes your app more complex because you must now write the code to manage multiple documents or tabs yourself. 

    For  Microsoft Edge, it just like multiply views you have read.

    Tuesday, January 26, 2016 9:42 AM
  • I think Multiple views is what i want. I have no idea what that´s is but i will search for it.

    Thanks a lot

    Tuesday, January 26, 2016 10:44 AM
  • Wednesday, January 27, 2016 12:57 AM