문제

I have a mobile application on a windows ce 6.0 device. The device sometimes is sent to suspend by a hardwarebutton. I want to do some tasks, as soon, the device is resumed.

Is it possible to check in a .net cf-program, if the device was resumed?

Thanks!

도움이 되었습니까?

해결책 3

Thanks for your answers...

On further reasearching I found a event in OpenNETCF, fitting just my needs.

The event OpenNETCF.WindowsCE.PowerManagement.PowerUp is fired, when resuming a device - everything works fine here...

다른 팁

According to this previous question, it's not possible without resorting to P/Invoke or a 3rd-party library.

Yep. you have to subscribe to the PowerNotification queue and then watch for the resume event that is fired after the suspend/resume cycle. Here is a CF class that implements this without the OpenNetCF monster: http://win-mobile-code.googlecode.com/svn/trunk/NotificationList/NotificationsList/PowerNotifications.cs

The above is part of my 'What wakes up your device' article at http://www.hjgode.de/wp/2013/05/13/mobile-development-manage-the-event-db-what-wakes-up-your-device/

But use OpenNetCF if you need more of the functionality implemented by OpenNetCF.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top