You can register to be notified when this happens:
UInt32 value;
err = FtrGet(sysFtrCreator, sysFtrNumNotifyMgrVersion, &value);
Boolean notificationMgrPresent = (errNone == err && value);
if (notificationMgrPresent)
{
UInt16 nCard;
LocalID localDB; err = SysCurAppDatabase(&nCard, &localDB);
if (errNone == err)
{
err = SysNotifyRegister(nCard, localDB, sysNotifyLateWakeupEvent,
NULL, sysNotifyNormalPriority, NULL);
}
}When the machine is powered back on you can handle it in PilotMain:
case sysAppLaunchCmdNotify: { if (sysAppLaunchFlagSubCall & launchFlags) { SysNotifyParamType* parm = (SysNotifyParamType*) cmdPBP; if (sysNotifyLateWakeupEvent == parm->notifyType) { ..... do something ...... } }
break;
}Bob
At 03:19 PM 8/24/2003 +0200, you wrote:
Hi,
I need to know whether the Palm was turned off and on again while a program is running.
Therefore I wait until the 'key down event' occurs.
if (event->eType == keyDownEvent) { if (event->data.keyDown.chr == vchrPowerOff) { ... } }
This works fine, but if the user is in a palm specific dialog (e.g. the graffiti reference or the keyboard) which can be called within a program it doesn't work anymore.
My idea was to change the 'EventHandler' of these forms, but I couldn't figure out how to change it.
Any ideas how this problem could be solved.
MfG Steffen -- Zu sagen 'Hier herrscht Freiheit' ist immer ein Irrtum oder auch eine L�ge -- Freiheit herrscht nicht (Erich Fried)
--
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/
