How to keep a program running while in Standby mode

  • Thread starter Thread starter A Coder again
  • Start date Start date
A

A Coder again

Hi !

I'm working on a project that would need to keep working for data
synchro reasons. And I need it to be working even when the PDA is
StandBy (Black screen and all). how can it be accomplished? I really
need some help on this one. I've tried a timer and also a thread, they
both stop working during the standby.

Thanks in advance for a reply
 
If you mean "suspend", then *nothing* is running, including the OS kernel.
If you change that, it won't be suspended any more. Change the
configuration for the device to never suspend, but allow turning off the
display after some period of inactivity, if you really need to do this. Or,
set up a CeRunAppAtTime() call to ask the OS to start up when you need it to
run, then put it back to sleep when you're done with what you're doing.
This is how the alarm clock and reminders for calendar items on Pocket PC
work.

Paul T.
 
I too am interested in this. Can I somehow turn off the suspend mode in
code and then re-enable it when I have finished importing my data?

Thanks

Pete
 
You can call SystemIdleTimerReset(). That's really the only perfectly
controlled way to do it. You could disable suspend by changing the
registry, send the notification to the system that you've changed it, etc.
but there are a lot of unknowns that you'll have to figure out in order to
make that work.

Paul T.
 
On PPC there's also "unattended mode" which would probably do what they're
after. Google will get the API call for it.


--
Chris Tacke
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--



"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:%[email protected]...
 
Thanks to all for the VERY QUICK responses. I'll give a try on your
suggestions today and post my experiments results for the people to
read.

Tankyou very much to all.

On PPC there's also "unattended mode" which would probably do what they're
after. Google will get the API call for it.


--
Chris Tacke
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--



"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:%[email protected]...
You can call SystemIdleTimerReset(). That's really the only perfectly
controlled way to do it. You could disable suspend by changing the
registry, send the notification to the system that you've changed it, etc.
but there are a lot of unknowns that you'll have to figure out in order to
make that work.

Paul T.
 
A somewhat related question: PPC is designed to close apps after a
certain elapsed time without activity, i seem to recall finding a way
to prevent this but havent been able to find it recently. any pointers
Thanks to all for the VERY QUICK responses. I'll give a try on your
suggestions today and post my experiments results for the people to
read.

Tankyou very much to all.

On PPC there's also "unattended mode" which would probably do what they're
after. Google will get the API call for it.


--
Chris Tacke
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--



"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:%[email protected]...
You can call SystemIdleTimerReset(). That's really the only perfectly
controlled way to do it. You could disable suspend by changing the
registry, send the notification to the system that you've changed it, etc.
but there are a lot of unknowns that you'll have to figure out in order to
make that work.

Paul T.

in message I too am interested in this. Can I somehow turn off the suspend mode in
code and then re-enable it when I have finished importing my data?

Thanks

Pete
 
The PPC closes apps only on low-memory conditions. It can be set to show
the today screen after a period of non-use, but the apps continue to run.


--
Chris Tacke
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--


Boomhauer said:
A somewhat related question: PPC is designed to close apps after a
certain elapsed time without activity, i seem to recall finding a way
to prevent this but havent been able to find it recently. any pointers
Thanks to all for the VERY QUICK responses. I'll give a try on your
suggestions today and post my experiments results for the people to
read.

Tankyou very much to all.

On PPC there's also "unattended mode" which would probably do what
they're
after. Google will get the API call for it.


--
Chris Tacke
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--



"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
DOT
com> wrote in message You can call SystemIdleTimerReset(). That's really the only
perfectly
controlled way to do it. You could disable suspend by changing the
registry, send the notification to the system that you've changed it,
etc.
but there are a lot of unknowns that you'll have to figure out in
order to
make that work.

Paul T.

"Peter Morris [Droopy eyes software]" <[email protected]>
wrote
in message I too am interested in this. Can I somehow turn off the suspend mode
in
code and then re-enable it when I have finished importing my data?

Thanks

Pete
 
Boom,

On keeping the app from closing on the PPC. Create an event handler
for the Closing event of your main form. Also create some boolean flag
that you'll set to true when you'll explicitly closing the app. If the
OS tries to close your app before you're ready for it to close, set
the Cancel property of the CancelEventsArgs of the Closing event
handler.

private void App_Closing(object sender, CancelEventArgs e) {
// If _closing has not been set, then the OS is attempting to close
// application to preserve Memory Resources.
if (!_closing) {
// Setting cancel property to true will cancel the attempt to
close
// the app.
e.Cancel = true;
}
}


FIll
A somewhat related question: PPC is designed to close apps after a
certain elapsed time without activity, i seem to recall finding a way
to prevent this but havent been able to find it recently. any pointers
Thanks to all for the VERY QUICK responses. I'll give a try on your
suggestions today and post my experiments results for the people to
read.

Tankyou very much to all.

On PPC there's also "unattended mode" which would probably do what they're
after. Google will get the API call for it.


--
Chris Tacke
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--



"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message You can call SystemIdleTimerReset(). That's really the only perfectly
controlled way to do it. You could disable suspend by changing the
registry, send the notification to the system that you've changed it, etc.
but there are a lot of unknowns that you'll have to figure out in order to
make that work.

Paul T.

in message I too am interested in this. Can I somehow turn off the suspend mode in
code and then re-enable it when I have finished importing my data?

Thanks

Pete
 
Back
Top