<p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background-color:rgb(255,255,255);clear:both;word-wrap:break-word;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:18px;text-align:left">
<br></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background-color:rgb(255,255,255);clear:both;word-wrap:break-word;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:18px;text-align:left">
I want to write an application that puts the system in to different sleep states. Like S0,S1...S4.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background-color:rgb(255,255,255);clear:both;word-wrap:break-word;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:18px;text-align:left">
Before changing from one state to another I want to know the current/previous sleep state. </p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background-color:rgb(255,255,255);clear:both;word-wrap:break-word;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:18px;text-align:left">
For Ex: If the current state is S0 then I want to put it to S1. Or if the previous state was S3 then I want to put the system to S4.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background-color:rgb(255,255,255);clear:both;word-wrap:break-word;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:18px;text-align:left">
I want to know how can I get this state info from python using Win32 apis. The related struct I found on MSDN is <span style="font-family:Consolas,Courier,monospace;font-size:12px;background-color:transparent">SYSTEM_POWER_STATE </span></p>
<p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background-color:rgb(255,255,255);clear:both;word-wrap:break-word;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:18px;text-align:left">
<a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa373227(v=vs.85).aspx">http://msdn.microsoft.com/en-us/library/windows/desktop/aa373227(v=vs.85).aspx</a>
</p><div>Any help would be greatly appreciated!!!!</div>-- <br>Br,<br>Prashant G.P<br>