Thanks a million.

-----Original Message-----
From: Gavin Maxwell [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 21, 2001 4:15 PM
To: Palm Developer Forum
Subject: RE: Trapping Sleep Mode


This comes direct from Memo Pad source...

// To register do something like this

        err = SysCurAppDatabase(&cardNo, &dbID);
        ErrNonFatalDisplayIf(err != errNone, "can't get app db info");
        if(err == errNone)
        {
                err = SysNotifyRegister(cardNo, dbID,
sysNotifyLocaleChangedEvent,
                                                                NULL,
sysNotifyNormalPriority, NULL);
        }


// Then in your PilotMain

        else if (cmd == sysAppLaunchCmdNotify)
        {
                if (((SysNotifyParamType*)cmdPBP)->notifyType ==
sysNotifyLocaleChangedEvent)
                {
                        // Do something here
                }
        }

Cheers,
Gavin.

-----Original Message-----
From: Andrea [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 21, 2001 5:50 PM
To: Palm Developer Forum
Subject: RE: Trapping Sleep Mode


Hi Gavin, 

Sorry to bother... can i have some examples on calling SysNotifyRegister?


-----Original Message-----
From: Gavin Maxwell [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 21, 2001 3:44 PM
To: Palm Developer Forum
Subject: RE: Trapping Sleep Mode


Nope - that won't work.

You gotta call SysNotifyRegister. As an application you will then receive a
sysAppLaunchCmdNotify launch code sent to you with the appropriate details
in the parameter block. If you are writing something other than a normal app
you provide SysNotifyRegister with a callback. Check the docs - it's all
there.

Don't forget to call SysNotifyUnregister when you are no longer ineterested
in receiving notifcations.

Be careful of what I said before about the guaranteed delivery of these -
especially since it looks like you are dealing with hardware...

Cheers,
Gavin.

-----Original Message-----
From: Andrea [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 21, 2001 5:21 PM
To: Palm Developer Forum
Subject: RE: Trapping Sleep Mode


Hi Gavin

This is how i check for Sleep Mode. I am unable to get into the case.

static void AppEventLoop(void)
{
  UInt16 error;
  EventType event;

  do {
        EvtGetEvent(&event, evtWaitForever);
        if (event.eType == sysNotifyLateWakeupEvent)
                // Open Serial Comm.
        if (event.eType == sysNotifySleepRequestEvent)
                // Close Serial Comm.
        if (! SysHandleEvent(&event))
                if (! MenuHandleEvent(0, &event, &error))
                        if (! AppHandleEvent(&event))
                                FrmDispatchEvent(&event);

  } while (event.eType != appStopEvent);
}

Please advise.

Regards,
Andrea

-----Original Message-----
From: Gavin Maxwell [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 21, 2001 2:52 PM
To: Palm Developer Forum
Subject: RE: Trapping Sleep Mode


There are virtual characters posted when the device is about to enter sleep
mode.

vchrAutoOff is the one you're after most likely, or
vchrPowerOff, or
vchrHardPower (user pressing power button)


If you are running on a device with the Notification Mgr (OS 4.0) you can
register for these instead of checking keyDown events:

sysNotifySleepRequestEvent
sysNotifySleepNotifyEvent

Note that these may not be posted in all circumstances (ie emergency power
off due to extremely low battery)


If your intention is to stop the device going to sleep then you might want
to look at these instead:

EvtResetAutoOffTimer
EvtSetAutoOffTimer

Regards,
Gavin.

-----Original Message-----
From: Andrea [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 21, 2001 4:11 PM
To: Palm Developer Forum
Subject: Trapping Sleep Mode


Hi,

Does anyone knows how to trap an event when Palm is entering Sleep mode?
Please advise.

Regards,
Andrea

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

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

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

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

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

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

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

Reply via email to