Or do I have to pinvoke native code?
I don’t want the power status…well I do, but I don’t want to poll it all the time and would rather have an event fire.
Or do I have to pinvoke native code? I don’t want the power status…well
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No there is not. Generally an application is completely unaware of the power state. When the device suspends, code simply stops executing. When you resume, it starts again at the exact spot it left off.
You can hook into the power management system to get notifications, though be aware that you don’t have time to actually react, so it’s likely that your code can’t actually handle the ‘going to sleep’ event until after it wakes again.
Both These state transitions are exposed in managed functions in the Smart Device Framework‘s OpenNETCF.WindowsCE.PowerManager class.