According to the guidelines, my Compact Framework app saves its state by overriding OnClosing, and storing its data safely away. This works when the program is swapped out by Windows Mobile, via a WM_CLOSE message.
Unfortunately, this method is not being called when the phone is being shut down (by one of the many reboot apps) via ExitWindowsEx or when the power button is held down and shutdown is chosen. This is on a WM 6.5 device.
Is there any way to find out that shutdown is occurring, or must I instead save my state every time I get deactivated?