Download Brutus, to lock, log off, restart, shut down Windows
Brutus is a free utility that will let you log off, restart, lock or shut down your computer easily. You can use Brutus Control Panel to adjust settings. Brutus Control Panel can be reached from the start menu.
If you want to leave the house immediately or go to sleep, you can safely let Brutus perform unattended shutdown.
The configuration that works for me is by selecting / checking two options: “Terminate hung applications” and “Try to end applications automatically”.
For an equally effective yet easier freeware, working also on Windows 8, check Windows Rule.