Sometimes you may experience and app that just hangs, and you are unable to close it in the normal fashion. You can use this registry change to automatically close hung apps after a specified period of time.
To adjust the timout, you can change the settings in bold. The values are in milliseconds, so if you want a hung app to end after five seconds, you’d enter 5000 in the appropriate field.
[HKEY_CURRENT_USERControl PanelDesktop]
"AutoEndTasks"="1"
"HungAppTimeout"="1000"
"WaitToKillAppTimeout"="2000"
"LowLevelHooksTimeout"="1000"