Controlling the application's life cycle
One of the biggest differences with the UWP model, compared to the more traditional Win32 one, is the application life cycle. Since UWP apps were originally created to run on multiple devices (including less powerful ones compared to a computer, such as mobile phones or tablets), Windows implements a series of optimizations to avoid an application consuming too much memory or CPU, making the system unstable.
Here are some of the key differences compared to the life cycle of a Win32 application:
- Applications aren't able to run in the background: A few seconds after an application has been minimized to the taskbar, it gets suspended and isn't able to perform any operations. If you need to perform operations in the background, you must use special features, such as background tasks.
- When an application is suspended, it doesn't consume CPU (since it can't perform any task) but it still uses memory: The process...