prashant padaganur wrote: > > Thanks Tim. But when the system is in S0 state I want to read that > information from the system.
You want to read WHAT information from the system? Look, here is a complete Python program that accurately tells you the current power state: print "The system is now in S0." If you have a window (even a hidden window), you can grab the WM_POWERBROADCAST message to learn when the system is about to leave S0, and when the system is back in S0 after being in another state, but if you are running, the system is in S0. And that message doesn't tell you which state you are going to or from. > May be as suggested I can try getting the previous states from Windows event > logger. So, when you're in S0, you want to know what state we were in the last time we were NOT in S0? I'm not sure there's any reliable way to do that without using a driver. Kernel drivers get reliable messages on each power state transitions that indicate both the old state and the new state. Even a user-mode (UMDF) driver can do that. Perhaps that would solve your issue. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32