On most newer computers you can shutdown the hard way by pressing the power button for a couple of seconds. But I want to prevent this completely.
You're able to prevent some soft events like the sleep, suspend, hibernate and "Press power button" events in Windows control panel; you can also use some Win32 and WDI programming to catch and handle/deny those events but it doesn't seem to stop the mechanical power off when you hold the button for a longer time.
I guess the power button is hard-wired to the power supply and never waits for the OS when you hold it down for some seconds? Or is there some way to prevent even this case by code?
I'm a .NET developer.
Whooaaa...! Lots of you really argued for not doing this - "You don't own my computer or my OS", - "are you developing SkyNet" etc :) This application is a highly customized and closed solution for some customers. It's a kiosk application on customized hardware running on Windows XP Embedded and use a touch screen. It's not public.