We are seeing some occasional data loss with our application on Windows Mobile, and we suspect that some buffered data is not being flushed to disk when the device is suspending. We would like to manually flush data to the disk when the device is about to suspend. On Windows, we do this by catching the WM_POWERBROADCAST
message, but this message is not available on Windows Mobile. I found a two-year-old quote on a message board that said:
You need to realize that you are *not* guaranteed that you will be notified of the suspend *before* you wake up again. That is, you might not receive the notification until after the device has been reawakened. Generally, you should not be trying to react to suspend because of this limitation (and the limitation on what you can do in response to the event, anyway).
Is this (still) true for all devices? Is there a way we can do this?