You will have to do it before you pass the event to the OS for handling.
All OS event definitions are listed in the SDK headers (event.h).  Use an
event pre-handler routine to look for the low battery warning event before
passing the event onto the OS.  However, when you do encounter a low battery
event, you will have to check the battery thresholds yourself as the OS post
the message frequently just to check the levels.  If the current battery
level is below the warning threshold, you can assume a low battery warning
event is about to happen.  Clean up your app and let the OS handle it.  A
warning: Don't take too long to clean up.  Once a low battery level has been
detected, you cannot rely on having a specific amount of time before the
unit could permanently loose power.  Once that happens, you usually have 2
minutes or less to recharge or replace the batteries.  The further away from
completely depleted you allow the unit to shut down, the longer the memory
will be retained.

Some routine you may use:
EvtGetEvent
SysBatteryLevel
EvtAddEventToQueue

----- Original Message ----- 
From: "Chris Apers" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Thursday, April 08, 2004 11:19 AM
Subject: Re: Battery low


> OK, or perhaps i can catch an event before the dialog is shown
> just to unlock the screen ?
>
>
> ----- Original Message ----- 
> From: "Dave Lippincott" <[EMAIL PROTECTED]>
> To: "Palm Developer Forum" <[EMAIL PROTECTED]>
> Sent: Thursday, April 08, 2004 3:09 PM
> Subject: Re: Battery low
>
>
> > Its possible but if you do, you run the risk of loosing everything on
the
> > hand held.  Its best to just let the OS handle the message.
> >
> > ----- Original Message ----- 
> > From: "Chris Apers" <[EMAIL PROTECTED]>
> > To: "Palm Developer Forum" <[EMAIL PROTECTED]>
> > Sent: Thursday, April 08, 2004 6:11 AM
> > Subject: Battery low
> >
> >
> > > Hi,
> > >
> > > Is it possible to prevent low battery dialog to be show ?
> > > I'd like to just show an icon but don't want to stop my app.
> > >
> > > Thanks
> > > Chris
> > >
> > > -- 
> > > For information on using the Palm Developer Forums, or to unsubscribe,
> > please see http://www.palmos.com/dev/support/forums/
> > >
> >
> >
> >
> > -- 
> > For information on using the Palm Developer Forums, or to unsubscribe,
> please see http://www.palmos.com/dev/support/forums/
> >
>
> -- 
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
>



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to