Windows 10 UAP - Application.Suspending event - win-universal-app

In Windows 10 universal application which is running in desktop environment, in what cases can be Application.Suspending event fired? One case is closing the app (for example with Alt+F4), are there any other cases? I thought that Alt+Tab would also fire this event but strangely that's not the case, why?

Application.Suspending on Mobile will fire whenever the user navigates to another screen via the task switcher, hitting the back button from the root page, hitting home, on when a phone call is received etc.
On Desktop, it will fire whenever the application is minimized.
However, it will ALSO fire on both desktop AND mobile when the app is on the way to being terminated for any reason.
On Desktop this is when alt+f4 is hit, or the window is closed.
On Mobile, by the time the window is being terminated (low memory or killed in switcher), the Application.Suspending event will have already fired.
Alt+Tab on desktop will not suspend the event as the window is still running as a live preview because it is visible to the user.
Check out this video from Microsoft Virtual Academy for a great look at the Windows Universal App lifecycle, or check out the App Lifecycle docs from MSDN.
Hope this helps

Related

Make electron window able to receive click event when above keynote app

I am working on electron app where i open a child window which i want to be above all the windows (not above fullscreen windows though), I managed to do it by using
win.setAlwaysOnTop(true, "screen-saver");
It now stays on top of all other open apps and keynote app presentation mode, i want user to be able to click buttons inside my window but now the issue is as soon as user clicks on button or just window in my child window, keynote window minimizes (as focus shifts to my window).
What i tried : I tried almost all available window option given in electron docs with different variations, I also tried playing with modals, but obviously modals stay in window itself, i want to keep main app minimized and keep child window on top of other apps. I also found electron-modal package, but that also behaves same.
working example
I was trying different application to check is any other application is able to do it, and i found that zoom app window (in screen share mode) is able to stay on top of keynote app and you can click buttons inside that app, you can move window, and keynote app keeps running in the background with no issues. I am trying to achieve exactly same behaviour.
This is something that you won't be able to recreate with electron currently, except through a native node module that manipulates your window related OS flags.
You can follow this issue on the Electron repository, since the flags introduced there should resolve your issue, or at least give you a point of entry to make your own PR or node_module.
https://github.com/electron/electron/issues/10078

Electron : App minimize or not visible after click outside browserWindow or Windows key+D

I am developing a desktop widget which shows current system status. But the problem is when any user clicks outside of browser window the app get hide/not visible on the desktop. The same thing happens when user press key windows key +D. Is there anything that we can do for preventing this or catch this event and call window.show(). Because lots of desktop widget support this kind of feature.
Edit: I have tried alwaysOnTop property of browserWindow, but I don't want to show my app above the other apps. Like any desktop widget which always shows on the desktop.

Notify Birthdays while pc starts in window application using c#

I am developing an windows application in which I want birthdays reminder of the clients. So what I want is, when my pc starts, a program file should run automatically(i.e without click on the icon of setup) and fetch the records from database and show it to notify icon.
If you hae any idea regarding this please tell the flow.
Thanks in advance

How to close tabris application

Is it possible to minimize or close tabris application (client side) ?
I wanna accomplish the same behavior that is implement on hardware control. (back button on top level page or home button) but I wanna invoke this when a certain criteria in my app is satisfied.
Thnx
On ios you can not close an application. On Android closing the last open shell (eg by pressing the back button or programmatic) also closes the app.

Want app upgraded to 4.0 to exit completely when home button pressed

I am working on an app for iOS 4.0. The app was originally on 2.2.1. I upgraded it to a universal app, but now it seems to be multitasking. When I press the menu button while running the app, instead of exiting it closes, but when I relaunch the app it resumes where I left off. I am assuming this is multitasking. I want it to exit, is there a way in the settings?
My guess is that the iPad target upgrade changed the plist somehow? Any thoughts?
Open your info.plist file
Add The Key UIApplicationExitsOnSuspend or Select Application does not run in background
Set the new key to YES or Fill in the tick box
That's not multitasking, that's Fast app switching which is now the default and is preferred in iOS 4.0.
If you disable it, that means you app has to be reloaded every time the user switches to it instead of allowing it to stay in memory. It will take longer to reload it each time.
It would be better if you implement applicationWillEnterForeground: and refresh your view rather than force the user to have to wait while your app reloads.

Resources