1

I have WPF app that can be only a Single Instance, I need to somehow handle custom URLs params in it?

In the Windows schema shell/open/command I have "C:\Users\Any\AppData\Roaming\MyApp\MyApp.exe" --my-param="%1".

When the app is not running it's super easy, to start the app and handle the params, but when there is already an instance what can I do?

In the ApplicationMutex where I check if it's the second instance, write something to the file that is observed by the first instance?

Dpio
  • 11
  • 4
  • "*write something to the file that is observed by the first instance?*" - or any other kind of IPC - you already added the right keyword to the question tags. – Clemens Feb 22 '22 at 13:26
  • Include the custom param in the name of Mutex or Semaphore, and when an instance starts, check if there would be existing Mutex or Semaphore of the same name. If found, send a message to the existing instance via IPC. – emoacht Feb 22 '22 at 13:44
  • You need to pass the argument to the already running process one way or another. – mm8 Feb 22 '22 at 14:48

0 Answers0