Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Prevent automatic power off in C#

Posted on 2006-04-18
4
Medium Priority
?
659 Views
Last Modified: 2011-10-03
Background:
Ok, I have a fancy C# mobile application that syncs my company's database to our mobile phones. Depending on the ammount of data, sometimes this can take between 5 - 10 minutes. My problem is that our devices will power off after 3 minutes of being idle. I do not want to change this, because normally this is a very good thing, but it can be a real pain in the neck when this program is running.

Platform:
Windows Mobile 5.0, .NET CF 2.0 and C#.

Problem:
I need a way to programmically prevent the device from being powered off for any reason while my Sync() preocess is running and then be able to bring it back to it's original state after the process is done.

I assume that I will need to trap a windows message, but I can't find the right one to do this.

Thanks in advance for you help.
0
Comment
Question by:Rickggoalie3
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
SystemExpert earned 2000 total points
ID: 16476857
Hi,

I don't have that much information but i found this link hope it may work for you

http://www.codeguru.com/cpp/w-p/ce/memorymanagement/article.php/c11113/

Thanks
0
 
LVL 14

Expert Comment

by:Thandava Vallepalli
ID: 16477497
You can programatically delay the shutdown using windows command

shutdown  


look at it

http://aumha.org/win5/a/shutcut.php

itsvtk
0
 
LVL 2

Author Comment

by:Rickggoalie3
ID: 16478542
SystemExpert: Thats looks like what I'll need. I hope you don't mind if I wait to assign points until I can try out the code tonight.

itsvtk: Please not the O/S. My program is running on WindowsMobile 5.0 not windows Xp. :)
0
 
LVL 2

Author Comment

by:Rickggoalie3
ID: 16484080
SystemExpert thank you so much for your help. Iv'e got a little work to do to port this to C#, but this is exactly what I needed.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question