When apps (tasks) do not end (close) automatically when you are restarting, shutting down, or signing out of Windows 10, the system will wait 5 seconds (HungAppTimeout) by default before the End Task dialog appears asking you to cancel or to close the listed apps and restart anyway, shut down anyway, or sign out anyway.
If you do not make a choice in the End Task dialog before the 1 minute timeout expires, Windows 10 will automatically cancel the restart, shutdown, or sign-out by default.
For example, if you have notepad open with unsaved changes when you restart, shut down, or sign out.
HungAppTimeout also specifies how long (5 seconds by default) the system waits for user processes to end after the user clicks/taps on the End task button in Task Manager. If this threshold is exceeded, the End Task dialog box appears, stating that the process did not respond.
This tutorial will show you how to specify the HungAppTimeout value for how long the system waits before the End Task dialog appears for your account or all users in Windows 10.