Check if application is running from a background task
问题 I'm creating an UWP application with a background task. I don't want to run the background when the real application is running or suspended. Is there some way to achieve that? I’ve looked on SystemConditionType but nothing fits what I'm looking for. 回答1: Since background tasks (except special ones) run in a separate process, there is not an elegant way to check if app is running or not since memory is not shared between the app and the background task. There are two ways that I implemented