>Folks - I'm writing an application that runs on dedicated Palms. Users are
>*not* supposed to be able to exit the app without entering a password
>(obviously resets will bypass anything I can do at this point).
>
>I can ignore appStop events, and this works fine for users tapping the
>applications button, and it'll also keep users from exiting via Find
>results. I can't stop the find dialog coming up, though, or the finds being
>executed.
>
>Is there a way to do this? I can't think of one.
There's probably an easier way, but one way that comes to mind is to test for
penDown events immediately after you call EvtGetEvent. If it's a penDown, check
the pen coordinates (they're accurate on penDown, despite my earlier postings
about incorrect penUp coordinates) - if they're in the range that would activate
the find button, don't pass the event on to any of the event handlers; just go
get another event.
in other words:
void EventLoop(void)
{
EventType event;
Word error;
do {
EvtGetEvent(&event,evtWaitForever);
// here's the magic lines to disable the Find...
if ((event.eType == penDown) &&
(event.screenX > 135) &&
(event.screenY > 190)) {
continue;
}
if (!SysHandleEvent(&event))
if (!MenuHandleEvent(NULL,&event,&error))
if (!ApplicationHandleEvent(&event))
FrmDispatchEvent(&event);
}
while (event.eType!=appStopEvent);
}
I'm just picking rough coordinates here; you'll have to look for the right
coordinates that outline the Find button...
- Al -
--
-- Alan Weiner -- [EMAIL PROTECTED] -- http://www.ajw.com