1

I managed to run a .exe file at startup using the answer given here: Running an EXE from C# using UWP

However, I need to run another executable when my UWP app is closed. Does anybody know how to do this? Is there a way to link two different exes to the FullTrustLauncher? Or maybe there is a way to parameterize the usage of this FullTrustLauncher? I know the launch async function can be parameterized, but I have no idea what there parameters are for. So, an example would be nice.

Cheers!

  • See this https://stackoverflow.com/questions/46008948/how-to-launch-a-full-trust-desktop-bridge-app-from-uwp-with-arbitrary-paramete – Ipsit Gaur Nov 17 '17 at 09:00

1 Answers1

0

That parameter cannot be used to customize things like what you think. Also UWP apps lifecycle has already wrote something like this: “There is not an event to indicate that the user closed the app.”

So if you really need to do something like this, maybe: 1. You can detect the user's close "X", see this doc: https://learn.microsoft.com/en-us/uwp/api/windows.ui.core.preview.systemnavigationmanagerpreview 2. Like Ipsit Gaur's link showed, follow Stefan's advice to create extra exe to read command strings.

However in general your request is not a good request. Or even it will leads a bad user experience in my mind.

Barry Wang
  • 1,459
  • 1
  • 8
  • 12