For Windows Vista and above, there is a fuction function defined in User32.dll (User32.lib) called "ShutdownBlockReasonCreate".
It takes two parameters:
- Window handle
- A string representing the displayed message
If the call succeeds, than the application will block the closing of windows.
This is a powerful feature and should not be abused!
source
share