0

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!

abc
  • 2,285
  • 5
  • 29
  • 64
  • possible duplicate of [Is there an event in compact framework that fires on suspend and resume?](http://stackoverflow.com/questions/338833/is-there-an-event-in-compact-framework-that-fires-on-suspend-and-resume) – ctacke Mar 06 '14 at 18:49

3 Answers3

0

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

Community
  • 1
  • 1
madman1969
  • 166
  • 2
0

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.

josef
  • 5,951
  • 1
  • 13
  • 24
0

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...

abc
  • 2,285
  • 5
  • 29
  • 64