static extern bool IsPwrShutdownAllowed();
Declare Function IsPwrShutdownAllowed Lib "powrprof.dll" () As Boolean