I have a routine I wrote for my Pocket PC device that can take up to 6 mins to run all the way though. (it is a complicated synchronization between the local DB and our SQL Server.) Anyway I have noticed that the handheld likes to shut itself off during the process. Is there a way that I can use the things API to temporally stop shutting down?

Also can I detect when the device shuts down so I can make the user type their password into the app when it turns back on?

Thanks!