>Subject: Re: Power off event
>From: thomas <[EMAIL PROTECTED]>
>Date: Tue, 14 Nov 2000 09:39:22 +0100
>I originaly asked this question. Thanks to those who gave me clues.
>here's how i manage to do that :
>static void AppEventLoop(void){
> Word error;
> EventType event;
> do{
> EvtGetEvent(&event, evtWaitForever);
> if (event.eType == keyDownEvent &&
> (event.data.keyDown.chr ==
> autoOffChr ||
> event.data.keyDown.chr == hardPowerChr)){
> // do what you want when power off
> }
> if (! SysHandleEvent(&event)){
> if (! MenuHandleEvent(0, &event, &error)){
>> if (! AppHandleEvent(&event)){
> FrmDispatchEvent(&event);
> }
> }
> }
> } while (event.eType != appStopEvent);
>}
Just keep in mind that this code will catch power off most of the
time, not all of the time. For example, it will not catch a power
off event when an alert screen is being displayed.
Roger Stringer
Marietta Systems, Inc.
--
For information on using the ACCESS Developer Forums, or to unsubscribe, please
see http://www.access-company.com/developers/forums/