User Key: HKEY_CURRENT_USER\Control Panel\Desktop
System Key: HKEY_USERS\.DEFAULT\Control Panel\Desktop
Create or modify the String value called HungAppTimeout and set the value as per your requirement (1000 = 1 second). e.g. if you set the value to 1000 then the system task manager will terminate the application after waiting for 1 second.
NOTE: System need to restart for the change to take effect.