PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework How to keep a program running while in Standby mode

Reply

How to keep a program running while in Standby mode

 
Thread Tools Rate Thread
Old 06-09-2006, 07:28 PM   #1
A Coder again
Guest
 
Posts: n/a
Default How to keep a program running while in Standby mode


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

  Reply With Quote
Old 06-09-2006, 07:40 PM   #2
Paul G. Tobey [eMVP]
Guest
 
Posts: n/a
Default Re: How to keep a program running while in Standby mode

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.

"A Coder again" <cthivierge@gazmetro.com> wrote in message
news:1157567308.940138.97260@d34g2000cwd.googlegroups.com...
> 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
>



  Reply With Quote
Old 06-09-2006, 08:13 PM   #3
Peter Morris [Droopy eyes software]
Guest
 
Posts: n/a
Default Re: How to keep a program running while in Standby mode

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


  Reply With Quote
Old 06-09-2006, 08:24 PM   #4
Paul G. Tobey [eMVP]
Guest
 
Posts: n/a
Default Re: How to keep a program running while in Standby mode

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]" <pete@droopyeyes.no.com.spam> wrote in
message news:uy6Vcie0GHA.4264@TK2MSFTNGP05.phx.gbl...
>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
>



  Reply With Quote
Old 06-09-2006, 09:54 PM   #5
Guest
 
Posts: n/a
Default Re: How to keep a program running while in Standby mode

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:%23VdbEoe0GHA.3908@TK2MSFTNGP05.phx.gbl...
> 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]" <pete@droopyeyes.no.com.spam> wrote
> in message news:uy6Vcie0GHA.4264@TK2MSFTNGP05.phx.gbl...
>>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
>>

>
>



  Reply With Quote
Old 07-09-2006, 11:19 AM   #6
A Coder again
Guest
 
Posts: n/a
Default Re: How to keep a program running while in Standby mode

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.

<ctacke/> wrote:
> 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:%23VdbEoe0GHA.3908@TK2MSFTNGP05.phx.gbl...
> > 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]" <pete@droopyeyes.no.com.spam> wrote
> > in message news:uy6Vcie0GHA.4264@TK2MSFTNGP05.phx.gbl...
> >>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
> >>

> >
> >


  Reply With Quote
Old 07-09-2006, 07:46 PM   #7
Boomhauer
Guest
 
Posts: n/a
Default Re: How to keep a program running while in Standby mode

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
on this?



A Coder again wrote:
> 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.
>
> <ctacke/> wrote:
> > 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:%23VdbEoe0GHA.3908@TK2MSFTNGP05.phx.gbl...
> > > 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]" <pete@droopyeyes.no.com.spam> wrote
> > > in message news:uy6Vcie0GHA.4264@TK2MSFTNGP05.phx.gbl...
> > >>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
> > >>
> > >
> > >


  Reply With Quote
Old 07-09-2006, 08:49 PM   #8
Guest
 
Posts: n/a
Default Re: How to keep a program running while in Standby mode

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" <boomhauer@gmail.com> wrote in message
news:1157654789.573643.123890@e3g2000cwe.googlegroups.com...
>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
> on this?
>
>
>
> A Coder again wrote:
>> 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.
>>
>> <ctacke/> wrote:
>> > 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:%23VdbEoe0GHA.3908@TK2MSFTNGP05.phx.gbl...
>> > > 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]" <pete@droopyeyes.no.com.spam>
>> > > wrote
>> > > in message news:uy6Vcie0GHA.4264@TK2MSFTNGP05.phx.gbl...
>> > >>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
>> > >>
>> > >
>> > >

>



  Reply With Quote
Old 07-09-2006, 10:39 PM   #9
Functional Illiterate
Guest
 
Posts: n/a
Default Re: How to keep a program running while in Standby mode

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

Boomhauer wrote:
> 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
> on this?
>
>
>
> A Coder again wrote:
> > 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.
> >
> > <ctacke/> wrote:
> > > 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:%23VdbEoe0GHA.3908@TK2MSFTNGP05.phx.gbl...
> > > > 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]" <pete@droopyeyes.no.com.spam> wrote
> > > > in message news:uy6Vcie0GHA.4264@TK2MSFTNGP05.phx.gbl...
> > > >>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
> > > >>
> > > >
> > > >


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off