How to veto suspend and shutdown request using C#?

Hi, I am writing a program that absolutely need to veto (cancel) any suspend and shutdown request initiated by user. Is there any way to do this in C# using managed code .NET 2.0 seems to only give PowerModeChangedEvent and doesn't give any option to veto.

Before you ask, yes, I am aware that a program should never veto a suspend request, but I really need to. And yes, I am aware that veto is no longer supported in Vista (which is fine as my program is specifically for XP).

Thank you very much.



Answer this question

How to veto suspend and shutdown request using C#?