bring uwp app in foreground

Briefkasten

I found posts about how to detect if the app runs in foreground. Is it possible to bring my UWP app to the foreground (when it runs in the background) somehow? Maybe it's possible with a background task?

der_michael

This is how I got it to work for UWP running on Windows 10:

  1. In your manifest create a protocol declaration (insert Name and Display name meaningful to your app)

    As explained here: https://marcominerva.wordpress.com/2012/12/10/make-an-app-respond-to-url-requests-using-protocol-declaration/

Start creating a new Windows Store app. For our purpose, a Blank App is enough. Now, we need to open the Package.appxmanifest file, go to Declarations tab and add Protocol from the Available Declarations list. Then, we specify the URI schema we want to handle in the Name property:

  1. In App settings for the protocol change the Desired view to Use Half

  2. Use the Launcher to call your registered protocol whenever your app should come to the foreground

In the example below replace yourprotocolhere with the protocol you registered for your app.

await Windows.System.Launcher.LaunchUriAsync(new Uri("yourprotocolhere://"));

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Phonegap - Bring from background to foreground

Possible to bring the app from background to foreground?

iOS10: tapping an action from local notification does not bring app to the foreground

Pywinauto: unable to bring window to foreground

Android Twilio Video Call, wake up app and bring to foreground

In Pyglet is there way to bring sprites to foreground

Nativescript - How to bring app to foreground when notification is pressed

How do I bring a polygon to the foreground in OpenGL?

Bring Android React Native App to Foreground On Receipt of Data Only Firebase Cloud Message

How can I bring the Kivy window to the foreground in a Kivy desktop app?

SwiftUI bring stack element to foreground

How to suspend and bring a background process to foreground

Startup program: bring to foreground

Unity unable to bring programs to foreground

Bring a UI Element to foreground

When I bring my app to the foreground doesn´t load the last activity

Bring a cronjob back to foreground

Bring nohup job to foreground

How to bring a nodejs app started with forever to foreground?

UWP FolderPicker Bring to Front of opening app

Bring application to foreground in ios

Bring Android app's previous instance to foreground from FCM notification

Bring android app in foreground after receiving respose from third party app in xamarin android

How to bring a child process to foreground

ServiceWorkerRegistration.showNotification in PWA, bring app to foreground

Bring UserControl in front of Window Foreground

How can I bring Electron app to foreground every "N" minute?

Bring a program to foreground or start it

Is there any way to bring shadowing to the foreground?