Override the classic shutdown dialog in Explorer
which is invoked with ALT+F4 with your own program.
This also lets you override the action of the "Log Off" button in Windows XP's Explorer, which on Windows 10 normally instantly logs the user out.