Monday, December 19, 2005 - Posts

Windows Mobile 5.0 SystemState on a background thread

In Windows Mobile 5.0 we have been given the SystemState class, which allows us to easially pick up on common System events, such as a new SMS or low battery power.

However, trying to use this class without a a Form seems to be not possible! For some reason the code needs a Window to work, yet i want it to work on a background process.

The best compromise I could think of was to use this technic from David Wrighton, in which you instantiate a Form, and hide it. It seems this has the extra benefit that it will appear in the 'Memory'->'Running Programs' control panel :)