Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am developing a windows service in c++.In my code I need to get the corresponding power states that the system last suspended while resuming from it,so that I can do my operations depending on STATES.

In general I am only getting WM_POWERBROADCAST / PBT_APMRESUMEAUTOMATIC if the suspended state is fast startup/hibernate/sleep.I need to differentiate these states for controlling my service.

What I have tried:

I need to enter the code to OnStartup() of service while user is updating anything in BIOS .But only after restart and shutdown it is entering to Onstartup() , for hibernate and fast startup after modifying in BIOS it is entering to case PBT_APMRESUMEAUTOMATIC
Posted
Comments
Rick York 22-Jul-19 16:30pm    
This is the Q&A section so what is your question? So far you have written only a few observations and requirements.
Member 12244492 23-Jul-19 8:12am    
I want to identify the power states in my code for distinguishing resuming from hibernate/sleep/shutdown/restart

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900